這是因爲我想在同一個項目中開發一個具有多個應用程序的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