I would like to make an application that Zend has the following structure:
-SITE
---- application
---- configs
---- layouts
---- modules
-------- default
------------ controllers
------------ forms
------------ models
------------ views
------------ Bootstrap.php
-------- admin
------------ controllers
------------ forms
------------ models
------------ views
------------ Bootstrap.php
---- Bootstrap.php
-- public
-- library
------My
---------Controller
-----------Plugin
-------------ModuleDispatch.php
------Zend
-- index.php
But I ran into problems reaching the admin module. I realized that perhaps my problem is routing and had implemented a written Plugin and the method preDispatch (). The name of Plugin is ModuleDispatch() and is in library/My/Controller/Plugin.
My application.ini file is:
[production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
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.modules = ""
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.frontController.plugins.moduleDispatch=ModuleDispatch
[staging : production]
[testing : production]
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
But when running, I always get the following error:
Fatal error: Class 'ModuleDispatch' not found in /var/www/study/library/Zend/Application/Resource/Frontcontroller.php on line 117 Call Stack: 0.0916 334628 1. {main}() /var/www/study/public/index.php:0 0.5735 1248652 2. Zend_Application->bootstrap() /var/www/study/public/index.php:25 0.5735 1248696 3. Zend_Application_Bootstrap_BootstrapAbstract->bootstrap() /var/www/study/library/Zend/Application.php:355 0.5735 1248696 4. Zend_Application_Bootstrap_BootstrapAbstract->_bootstrap() /var/www/study/library/Zend/Application/Bootstrap/BootstrapAbstract.php:586 0.6280 1282720 5. Zend_Application_Bootstrap_BootstrapAbstract->_executeResource() /var/www/study/library/Zend/Application/Bootstrap/BootstrapAbstract.php:626 0.6280 1283088 6. Zend_Application_Resource_Frontcontroller->init() /var/www/study/library/Zend/Application/Bootstrap/BootstrapAbstract.php:683
What could be wrong?