2010-11-08 77 views
1

有创建页面strucutere与Zend_Navigation(XML)这样的任何方法:Zend_Navigation XML结构(仪表板页)

- 1. Dashboard 
- - 1.1 New article 
- - 1.2 New user 
- - 1.3 New products 
- 2. Articles 
- - 2.1 New article 
- - 2.2 Reviews 
- 3. User 
- - 3.1 New user 
- - 3.2 Etc Etc... 
- 
- 

- 我'试图通过这个XML(例如XML),但它做的事工作,意想不到的,因为文章页面上都加载Dashborad和两个页面(Artcile ADN仪表板)页面激活:

<?xml version="1.0" encoding="UTF-8"?> 
<config> 
    <navigation> 
     <dashboard> 
      <label>Dashboard</label> 
      <module>admin</module> 
      <controller>index</controller> 
      <action>index</action> 
      <pages> 
       <add> 
        <label>New</label> 
        <module>admin</module> 
        <controller>recension</controller> 
        <action>add</action> 
       </add> 
      </page> 
     </dashboard> 
     <articles> 
      <label>Articles</label> 
      <module>admin</module> 
      <controller>articles</controller> 
      <action>index</action> 
      <pages> 
       <overview> 
        <label>Preview</label> 
        <module>admin</module> 
        <controller>articles</controller> 
        <action>index</action> 
       </overview> 
       <add> 
        <label>New</label> 
        <module>admin</module> 
        <controller>articles</controller> 
        <action>add</action> 
       </add> 
      </pages> 
     </articles>  
    </navigation> 
</config> 

感谢您的任何建议。

回答

1

它的工作原理应该是这样。 Zend_Navigation将页面设置为活动状态,因为它处于活动状态。如果你在不同的地方有相同的页面,并且不希望它们在同一页面处于活动状态,这意味着你的导航设计不好。

有两种解决方法

  1. 定义更多的Zend导航集装箱 - 但它并不容易
  2. 工作添加其他PARAMS到例如相对页面= dashbord确定单个活动页面

它会像

<dashboard> 
    <label>Dashboard</label> 
    <module>admin</module> 
    <controller>index</controller> 
    <action>index</action> 
    <pages> 
     <add> 
      <label>New</label> 
      <module>admin</module> 
      <controller>recension</controller> 
      <action>add</action> 
      <params> 
       <rel>dashboard</rel> 
      </params> 
     </add> 
    </page> 
</dashboard>