I am new in working with zend so I am facing this problem from the past two days. I have searched a lot but still can not find any solution.
Possible duplicate of Zend Module Bootstrap does not load but it still can not solve my problem.
In my User module everything is working perfect meaning models dbtables controllers but the Bootstrap.
I just want to add user relevant routes into the user module bootstrap I can also add them into the application bootstrap but I do not want to make it a large file.
I have this in my application/modules/User/Bootstrap.php
class User_Bootstrap extends Zend_Application_Module_Bootstrap
{
protected function _initRouter() {
//does not work i think it should work
echo 'joo';
exit;
}
}
As far as I know all bootsrap of modules run every time when we run the application but in my case it doesn't seems to be working.
Update:
in my application/configs/application.ini:
[production]
phpSettings.display_startup_errors = 0
phpSettings.display_errors = 0
includePaths.library = APPLICATION_PATH "/../library"
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
appnamespace = "Application"
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
resources.frontController.params.displayExceptions = 0
resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts/"
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.modules[] = ""
resources.db.adapter = "Mysqli"
resources.db.params.host = "xxxxx"
resources.db.params.username = "xxxxx"
resources.db.params.password = "xxxxx"
resources.db.params.dbname = "xxxxx"
resources.frontController.actionHelperPaths.Idispatch_Controller_Action_Helper = "Idispatch/Controller/Action/Helper/"
[staging : production]
[testing : production]
resources.cachemanager.database.frontend.options.caching = false
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
[development : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
resources.frontController.params.displayExceptions = 1
Bootstrap in my Application directory:
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap {
protected function _initAutoloaders() {
//user module loader
new Zend_Application_Module_Autoloader(array(
'namespace' => 'User', 'basePath' => APPLICATION_PATH . '/modules/User'
));
}
}
NOTE: I am using ZFW 1
I came here to ask hoping that someone will help me here. Please correct me if I am doing anything wrong. It will be a great appreciation.
Thanks.
resource.modules[] = ""
in your config or just in your question. It should beresources
– Adrian World