我創建3模塊,用於我的凸出 像這樣:未捕獲的異常 'Zend_Controller_Dispatcher_Exception' 與消息「無效控制器類( 「Error_ErrorController」)
應用程序/模塊/管理
應用程序/模塊/默認
應用程序/模塊/錯誤
每個模塊都有自己的cnotroller,view,layout文件夾。每一個事情是默認的模塊正確的,但是當我去管理模塊,我看到了這個錯誤(www.domain.com/public/admin)
Fatal error: Uncaught exception 'Zend_Controller_Dispatcher_Exception' with message 'Invalid controller class ("Error_ErrorController")' in E:\xampp\php\PEAR\Zend\Controller\Dispatcher\Standard.php:347 Stack trace: #0 E:\xampp\php\PEAR\Zend\Controller\Dispatcher\Standard.php(256): Zend_Controller_Dispatcher_Standard->loadClass('ErrorController') #1 E:\xampp\php\PEAR\Zend\Controller\Front.php(946): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #2 E:\zend_progamming\donyaye_fan_zend\application\Bootstrap.php(110): Zend_Controller_Front->dispatch() #3 E:\zend_progamming\donyaye_fan_zend\public\index.php(5): Bootstrap->runApp() #4 {main} thrown in E:\xampp\php\PEAR\Zend\Controller\Dispatcher\Standard.php on line 347
這是一個與此有關的錯誤我引導代碼:
$frontController->addModuleDirectory(ROOT_DIR . '/application/modules');
$frontController->setDefaultModule('default');
$frontController->registerPlugin(new Places_Controller_Plugin_ModuleSetup());
$frontController->registerPlugin(new Zend_Controller_Plugin_ErrorHandler(array(
'module' => 'error',
'controller' => 'error',
'action' => 'error'
)));
,這是我modulesetup類:
class Places_Controller_Plugin_ModuleSetup extends Zend_Controller_Plugin_Abstract{ public function dispatchLoopStartup(Zend_Controller_Request_Abstract $request)
{
// Set the layout directory for the loaded module
$layoutPath = ROOT_DIR . '/application/modules/' . $request->getModuleName() . '/layouts/scripts/';
Zend_Layout::startMvc(array('layoutPath' =>$layoutPath));
$autoloader = new Zend_Application_Module_Autoloader(array(
'namespace' => '',
'basePath' => ROOT_DIR . "/modules/",
));
$autoloader->addResourceTypes(array(
'admin' => array(
'path' => 'admin/',
'namespace' => 'admin'
),
'error' => array(
'path' => 'error/',
'namespace' => 'error')));
}
}