2010-07-09 23 views
2

Est-il possible de créer un sous-menu dans Zend Navigation?Créer un sous-menu avec Zend Navigation

A ce moment j'ai dans mon 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" 

Mais je veux le login et vous inscrire dans un sous-menu de compte.

Est-ce possible?

Merci

Répondre

2

Pour ajouter un sous-menu, vous devriez être en mesure de le faire en ajoutant

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" 

Essayez que ... Il cherche essentiellement la même structure que celle d'une configuration 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>