Zend_Navigation XML结构(仪表板页面)

时间:2010-11-08 16:01:05

标签: xml dashboard zend-navigation

是否有任何方法可以使用Zend_Navigation(xml)创建页面strucutere,如下所示:

- 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和Dashboards)都是活动的:

<?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 个答案:

答案 0 :(得分:1)

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

有两种解决方法

  1. 定义更多zend导航容器 - 但使用
  2. 并不容易
  3. 向页面添加其他参数,例如rel = dashbord以确定单个活动页面
  4. 这就像是

    <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>