I'm working with multi-modules CMS in Zend Framework. I want to create a structure like this:
testsite/
index.php
library/
zend/
test/
application/
configs/
application.ini
modules/
users/
controllers/
models/
....
frontend/
controllers/
models/
....
backend/
controllers/
models/
...
bootstrap.php
I have created the following code:
//in application.ini
resources.frontController.defaultModule = "frontend"
resources.frontController.defaultControllerName = "index"
resources.frontController.defaultAction = "index"
resources.frontController.plugins.init = "Test_Controller_Plugin_Initializer"
//in bootstrap.php
protected function _initControllers()
{
$this->bootstrap('frontController');
$this->_front = $this->getResource('frontController');
$this->_front->addControllerDirectory(APPLICATION_PATH . '/backend/controllers', 'backend');
$this->_front->addControllerDirectory(APPLICATION_PATH . '/frontend/controllers', 'frontend');
}
//in Test/controllers/plugin/initializer.php
public function preDispatch(Zend_Controller_Request_Abstract $request)
{
$front = Zend_Controller_Front::getInstance();
$request = $front->getRequest();
$request->setModuleName('frontend');
$request->setControllerName('index');
$request->setActionName('index');
}
It does not work when I go to my base URL .../testsite
. Can you please let me know where I went wrong?