2011-04-09 7 views
1

내가 이렇게 내 PROJ 에 대한 3 모듈을 만들 :catch되지 않은 예외'Zend_Controller_Dispatcher_Exception는 '

응용 프로그램/모듈/관리자

응용 프로그램/모듈/기본

응용 프로그램/모듈/오류

모든 모듈 자체에는 제어기,보기, 레이아웃 폴더가 있습니다. 모든 일이 기본 모듈 올바른지,하지만 난 관리 모듈에 갈 때 나는이 오류를 (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'))); 

} 

}

답변

3

내가 답을 발견에서 errorController는 오류 디렉토리 이름 befor를 error_errorController와 같은 클래스 이름으로 지정해야합니다.

0

errorControl.php는 컨트롤러 폴더에서 사용할 수 없습니다. 이 파일을 사용할 수있게되면 errorControl.php 파일에서 사용자 정의 오류가 표시됩니다.

주요 문제는 : PHP 프로그램에서 errorControl.php 파일을 검색 할 때 코드에 오류가 있습니다. PHP 파일에서 오류를 제거하면이 오류가 발생하지 않습니다.

관련 문제