开发者

How to create Zend MVC sub module and control (activate/deactivate) them dynamically?

Is it possible to change the default Zend MVC structure like the following and somehow activate or deac开发者_如何学运维tivate the sub modules (profile/shop) in a main module (default)? Actually I want a plug me in type of interface where I can control a sub module to be available or not. Is there any better approach to reach my goal (plug me in style module)?

application

--admin
----user
------controllers
------forms
------views
----banner
------controllers
------forms
------views
----category
------controllers
------forms
------views
----product
------controllers
------forms
------views
----shop
------controllers
------forms
------views

--default
----profile
------controllers
------forms
------views
----shop
------controllers
------forms
------views
----blog
------controllers
------forms
------views

--layouts
----admin
------scripts
----default
------scripts

--models

In the above structure I have two modules admin and default. I need to divide them in sub modules like [ profile,shop,blog ] for default module and [ user,banner,category etc. ] for admin module. How can I achieve this?


You can probably use Zend_Router for that : when a module must be made unreachable, you add a route that redirects to another page/module (maybe a 404 page), and when the module must be back online, you just remove the previously created route.

http://framework.zend.com/manual/en/zend.controller.router.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜