zend_navigation和模块 [英] zend_navigation and modules

查看:86
本文介绍了zend_navigation和模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,我正在使用zend开发应用程序,并将该应用程序分为模块.

I am developing an application at the moment with zend and I have seperated the app into modules.

默认模块是未登录用户访问并可以自由浏览的主站点.登录时,根据用户类型,您将转到由简单ACL控制的模块A或模块B.如果您可以访问模块A,则不能访问模块B,反之亦然.两种用户类型都可以看到默认模块.

The default module is the main site where unlogged in users access and have free reign to look around. When you log in, depending on the user type you either go to module A or module B, which is controlled by simple ACLs. If you have access to Module A you can not access Module B and visa versa. Both user types can see the default module.

现在,我想使用Zend_Navigation来管理所有模块中的整个应用程序导航.我不确定该怎么做,因为我看到的所有示例都可以在模块或非常简单的应用程序中使用.

Now I want to use Zend_Navigation to manage the entire applications navigation in all modules. I am not sure how to go about this, as all the examples that I have seen work within a module or very simple application.

我试图让我的navigation.xml文件看起来像这样:

I've tried to have my navigation.xml file look like this:

<configdata>
<navigation>

        <label>Home</label>
        <controller>index</controller>
        <action>index</action>
        <module>default</module>

        <pages>
            <tour>
                <label>tour</label>
                <controller>tour</controller>
                <action>index</action>
                <module>default</module>
            </tour>

            <blog>
                <label>blog</label>
                <url>http://blog.mysite.com</url>                   
            </blog>

            <support>
                <label>Support</label>
                <controller>support</controller>
                <action>index</action>
                <module>default</module>
            </support>

        </pages>

</navigation>
</configdata>

这对于默认模块来说还可以,但是我将如何将其他模块转到该导航页面?每个模块都有其自己的主页,以及其他等等.

This if fine for the default module, but how would I go about the other modules to this navigation page? Each module has it's own home page, and others etc.

我最好为为处理ACL而编写的preDispatch插件中加载的每个模块添加一个唯一的navigation.xml文件吗?还是将它们保存在一个庞大的导航文件中?

Would I be better off adding a unique navigation.xml file for each module that is loaded in the preDispatch plugin that I have written to handle my ACLs?? Or keep them in one massive navigation file?

任何提示都是很棒的.

谢谢

赠予

推荐答案

格兰特,

我通常在每个模块下创建一个配置目录,并在其中放置一个navigation.xml文档.这有助于减轻交叉依赖问题.

I typically create a config directory under each module, and within there I place a navigation.xml document. This helps to mitigate cross dependency issues.

这篇关于zend_navigation和模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆