2009年11月4日星期三

Re: [fw-mvc] How to use common project prefix in modules?

-- Алексей Шеин <confik@gmail.com> wrote
(on Wednesday, 04 November 2009, 11:49 AM +0500):
> So, common models have this prefix, i.e. model user is named as
> MyProject_Model_User and it's ok. But all controllers don't have this prefix,
> i.e. common index controller is just IndexController, so I'd like to name it
> MyProject_IndexController and controllers in admin module should be
> MyProject_Adm_IndexController for example.
> How to do this?

You need to configure the front controller/dispatcher.

Add the following key/value pair to your configuration:

resources.frontcontroller.defaultmodule = "MyProject"
resources.frontcontroller.controllerdirectory.MyProject = APPLICATION_PATH "/controllers"

and that *should* do it.

--
Matthew Weier O'Phinney
Project Lead | matthew@zend.com
Zend Framework | http://framework.zend.com/

没有评论: