这是因为我想在同一个项目中开发一个具有多个应用程序的Web平台。如何将规则添加到Zend URL映射并编写多个MVC路径?
在任何MVC的Web应用程序,我们应该有这样的默认URL模式:
domain
/controller
/action
/parameters
1:在Zend的,我能做些什么(在哪些文件)更改此架构以在controller
名称之前添加application
名称?
预期结果:domain
/application
/controller
/action
/parameters
2:我怎样才能实现这个新的URL块的后果,我会分开MVC为每个应用程序而言,保持共享资源在一个单独的目录中?可我在Zend的autoloader
做什么样的变化预期结果:
/public_html/
/public_html/platform
/public_html/platform/apps
/public_html/platform/apps/base (user interface container)
/public_html/platform/apps/crm
/public_html/platform/apps/crm/model
/public_html/platform/apps/crm/view
/public_html/platform/apps/crm/control
/public_html/platform/apps/crm/public
/public_html/platform/apps/crm/public/css (and etc.)
/public_html/platform/apps/erp
/public_html/platform/apps/erp/model
/public_html/platform/apps/erp/view
/public_html/platform/apps/erp/control
/public_html/platform/apps/erp/public
/public_html/platform/apps/erp/public/js (and etc.)
/public_html/platform/sys
/public_html/platform/sys/core
/public_html/platform/sys/cfg
/public_html/platform/libs/
/public_html/platform/libs/zend
/public_html/platform/libs/template_it
/public_html/platform/libs/custom
首先第一件事情:您是否使用ZF1或ZF2? – STLMikey
@STLMikey我打算使用最新ZF2,但如果这种情况增加了两个困难,我可以建立一个简单的MVC和使用一些的Zend库,专为DB和PDF。 – PSyLoCKe
ZF2中的每个独立模块都在模块的module.config文件中定义了它自己的路由结构。如果跨模块需要共享结构,则应用程序配置文件将放置在这些位置。 – STLMikey