使用 Zend Navigation 创建子菜单

发布于 2024-09-08 20:38:13 字数 1028 浏览 4 评论 0原文

是否可以在 Zend Navigation 中创建子菜单?

此时我的 application.ini 中已包含此内容:

resources.navigation.pages.indexHome.label = "Home"
resources.navigation.pages.indexHome.controller = "index"
resources.navigation.pages.indexHome.action = "index"
resources.navigation.pages.indexLogin.label = "Login"
resources.navigation.pages.indexLogin.controller = "login"
resources.navigation.pages.indexLogin.action = "index"
resources.navigation.pages.indexRegister.label = "Register"
resources.navigation.pages.indexRegister.controller = "login"
resources.navigation.pages.indexRegister.action = "register"
resources.navigation.pages.indexDisclaimer.label = "Disclaimer"
resources.navigation.pages.indexDisclaimer.controller = "disclaimer"
resources.navigation.pages.indexDisclaimer.action = "index"
resources.navigation.pages.indexAbout.label = "About"
resources.navigation.pages.indexAbout.controller = "about"
resources.navigation.pages.indexAbout.action = "index"

但我希望在帐户的子菜单中登录和注册。

这可能吗?

谢谢

Is it possible to create a submenu in Zend Navigation?

At this time i've got this in my application.ini:

resources.navigation.pages.indexHome.label = "Home"
resources.navigation.pages.indexHome.controller = "index"
resources.navigation.pages.indexHome.action = "index"
resources.navigation.pages.indexLogin.label = "Login"
resources.navigation.pages.indexLogin.controller = "login"
resources.navigation.pages.indexLogin.action = "index"
resources.navigation.pages.indexRegister.label = "Register"
resources.navigation.pages.indexRegister.controller = "login"
resources.navigation.pages.indexRegister.action = "register"
resources.navigation.pages.indexDisclaimer.label = "Disclaimer"
resources.navigation.pages.indexDisclaimer.controller = "disclaimer"
resources.navigation.pages.indexDisclaimer.action = "index"
resources.navigation.pages.indexAbout.label = "About"
resources.navigation.pages.indexAbout.controller = "about"
resources.navigation.pages.indexAbout.action = "index"

But I want the login and register in a submenu of account.

Is that possible?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

绝不服输 2024-09-15 20:38:13

要添加子菜单,您应该可以通过添加

resources.navigation.pages.indexAccount.label = "Account"
resources.navigation.pages.indexAccount.controller = "account"
resources.navigation.pages.indexAccount.action = "index"
resources.navigation.pages.indexAccount.pages.login.label = "Login"
resources.navigation.pages.indexAccount.pages.login.controller = "auth"
resources.navigation.pages.indexAccount.pages.login.action = "login"
resources.navigation.pages.indexAccount.pages.logout.label = "Logout"
resources.navigation.pages.indexAccount.pages.logout.controller = "auth"
resources.navigation.pages.indexAccount.pages.logout.action = "logout"

Try that... 来完成,它基本上是在寻找与 XML 配置相同的结构。

<?xml version="1.0" encoding="utf-8"?>
<config>
    <nav>
        <currentuser>
            <label>Current User</label>
            <uri></uri>
            <resource>dude</resource>
            <pages>    
            <logout>
                <label>Logout</label>
                <controller>auth</controller>
                <action>logout</action>
                <resource>logout</resource>
                <order>300</order>
            </logout>
            <login>
                <label>Login</label>
                <controller>auth</controller>
                <action>login</action>
                <resource>login</resource>
                <order>100</order>
            </login>
            </pages>
        </currentuser>
        <sitenav>
            <label>SiteNave</label>
            <uri></uri>
            <pages>
            <clients>
                <label>Clients</label>
                <controller>client</controller>
                <action>index</action>
                <resource>client</resource>
                <order>110</order>
            </clients>
            <users>
                <label>Users</label>
                <controller>user</controller>
                <action>index</action>
                <resource>user</resource>
                <order>200</order>
                <pages>
                    <user_create>
                        <label>Create</label>
                        <controller>user</controller>
                        <action>create</action>
                        <resource>user_create</resource>
                        <order>1</order>
                    </user_create>
                </pages>
            </users>
            </pages>
        </sitenav>
      </nav>
</config>

To add a submenu, you should be able to do it by adding

resources.navigation.pages.indexAccount.label = "Account"
resources.navigation.pages.indexAccount.controller = "account"
resources.navigation.pages.indexAccount.action = "index"
resources.navigation.pages.indexAccount.pages.login.label = "Login"
resources.navigation.pages.indexAccount.pages.login.controller = "auth"
resources.navigation.pages.indexAccount.pages.login.action = "login"
resources.navigation.pages.indexAccount.pages.logout.label = "Logout"
resources.navigation.pages.indexAccount.pages.logout.controller = "auth"
resources.navigation.pages.indexAccount.pages.logout.action = "logout"

Try that... It's basically looking for the same structure as an XML configuration.

<?xml version="1.0" encoding="utf-8"?>
<config>
    <nav>
        <currentuser>
            <label>Current User</label>
            <uri></uri>
            <resource>dude</resource>
            <pages>    
            <logout>
                <label>Logout</label>
                <controller>auth</controller>
                <action>logout</action>
                <resource>logout</resource>
                <order>300</order>
            </logout>
            <login>
                <label>Login</label>
                <controller>auth</controller>
                <action>login</action>
                <resource>login</resource>
                <order>100</order>
            </login>
            </pages>
        </currentuser>
        <sitenav>
            <label>SiteNave</label>
            <uri></uri>
            <pages>
            <clients>
                <label>Clients</label>
                <controller>client</controller>
                <action>index</action>
                <resource>client</resource>
                <order>110</order>
            </clients>
            <users>
                <label>Users</label>
                <controller>user</controller>
                <action>index</action>
                <resource>user</resource>
                <order>200</order>
                <pages>
                    <user_create>
                        <label>Create</label>
                        <controller>user</controller>
                        <action>create</action>
                        <resource>user_create</resource>
                        <order>1</order>
                    </user_create>
                </pages>
            </users>
            </pages>
        </sitenav>
      </nav>
</config>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文