Fastest and easiest way to change controllers' module
I am developing my first Zend website, and I just finished the Back-office. The problem is that I did not create any module, but now that I have to develop the Front-office I would like to create a different module开发者_如何学Python.
Knowing that I already have about 20 controllers for my back-office, how could I easily change their module to "Administration" ?
Then I would place the front office in a "Public" module and the main engines will be left in the "Default" module.
Thanks for your help !
I assume you use Zend_Application
.
Enable modules in your application.ini:
resources.modules =
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.frontController.controllerDirectory.default = APPLICATION_PATH "/controllers"
Create a new file hierarchie for your new "Public" module:
library
public
application
- controllers // class UserController extends Zend_Controller_Action
- views
- modules
- frontend
- controllers // class Frontend_UserController extends Zend_Controller_Action
- views
Back-office:
http://server.tld/user/add
Frontend / Public:
http://server.tld/frontend/user/list
精彩评论