Zend framework Zend导航渲染问题

Zend framework Zend导航渲染问题,zend-framework,zend-navigation,zend-acl,Zend Framework,Zend Navigation,Zend Acl,这是我的导航XML格式,系统中有两个用户级别,管理员和超级管理员 当以管理员身份登录时,应显示所有菜单项,并且工作正常,对于超级管理员,仅应显示仪表板和统计信息 我的问题是,对于超级管理员,除了仪表板和统计数据,其他菜单项的标签(应该只为管理员显示)正在显示,是否有隐藏标签的方法。在我的例子中,除了dashboard,顶级菜单项没有任何操作 菜单与Zend ACL连接 <configdata> <nav> <dashboard> &

这是我的导航XML格式,系统中有两个用户级别,管理员和超级管理员

当以管理员身份登录时,应显示所有菜单项,并且工作正常,对于超级管理员,仅应显示仪表板和统计信息

我的问题是,对于超级管理员,除了仪表板和统计数据,其他菜单项的标签(应该只为管理员显示)正在显示,是否有隐藏标签的方法。在我的例子中,除了dashboard,顶级菜单项没有任何操作

菜单与Zend ACL连接

<configdata>

<nav>

    <dashboard>
        <label>Dashboard</label>
        <class>nav-top-item no-submenu</class>
        <controller>index</controller>
        <action>index</action>
        <resource>index</resource>
        <privilege>index</privilege>
    </dashboard>

    <app>
        <label>Apps</label>  
        <class>nav-top-item no-submenu</class>
        <uri>#</uri>

        <pages>
            <managefeaturedapps>
                <label>Manage Apps</label>                    
                <controller>app</controller>
                <action>index</action>
                <resource>app</resource>
                <privilege>index</privilege>
            </managefeaturedapps>             
            <managepage>
                <label>Filter Apps</label>                    
                <controller>app</controller>
                <action>filter-apps</action>
                <resource>app</resource>
                <privilege>filter-apps</privilege>
            </managepage>
         </pages> 
    </app>

    <user>
        <label>Users</label>  
        <class>nav-top-item no-submenu</class>
        <uri>#</uri>

        <pages>
            <allusers>
                <label>Registered Users / Developers</label>                    
                <controller>user</controller>
                <action>index</action>
                <resource>user</resource>
                <privilege>index</privilege>
            </allusers>
         </pages>
    </user>        

    <page>
        <label>Pages</label> 
        <class>nav-top-item no-submenu</class>
        <uri>#</uri>

        <pages>
            <addpage>
                <label>Add New Page</label>                    
                <controller>page</controller>
                <action>add-page</action>
                <resource>page</resource>
                <privilege>add-page</privilege>
            </addpage>         

         </pages> 
    </page>


    <statistics>
        <label>Statistics</label> 
        <class>nav-top-item no-submenu</class>
        <uri>#</uri>

        <pages>
            <viewstats>
                <label>Statistics</label>                    
                <controller>statistic</controller>
                <action>index</action>
                <resource>statistic</resource>
                <privilege>index</privilege>
            </viewstats>
         </pages>              
    </statistics>

</nav>

}你经历这种行为的原因就在这里

<statistics>
    <label>Statistics</label>
    <class>nav-top-item no-submenu</class>
            <uri>#</uri>

统计
导航顶部项目编号子菜单
#
当你应该

<statistics>
    <label>Statistics</label>
    <class>nav-top-item no-submenu</class>
    <controller>statistic</controller>
    <action>index</action>
    <resource>statistic</resource>
    <privilege>index</privilege>

统计
导航顶部项目编号子菜单
统计资料
指数
统计资料
指数

只要不定义资源的访问参数,任何人都可以使用它。

出现这种行为的原因就在这里

<statistics>
    <label>Statistics</label>
    <class>nav-top-item no-submenu</class>
            <uri>#</uri>

统计
导航顶部项目编号子菜单
#
当你应该

<statistics>
    <label>Statistics</label>
    <class>nav-top-item no-submenu</class>
    <controller>statistic</controller>
    <action>index</action>
    <resource>statistic</resource>
    <privilege>index</privilege>

统计
导航顶部项目编号子菜单
统计资料
指数
统计资料
指数

只要您不定义资源的访问参数,它对任何人都是可用的。

您还需要显示ACL代码。管理员和超级管理员具有几乎相同的ACL规则可以吗?您还需要显示ACL代码。管理员和超级管理员具有几乎相同的ACL规则可以吗?是的,这是我的问题。没有定义controller和action.Nope,是否还有其他方法可以克服这一问题。没有别的办法。你不希望ZF猜测这些参数应该是什么,是吗?是的,这是我的问题。没有定义controller和action.Nope,是否还有其他方法可以克服这一问题。没有别的办法。你不希望ZF猜测这些参数应该是什么,是吗?