1

i create 3 module for my proj like this:

application/module/admin

application/module/default

application/module/error

every module has itself cnotroller , view , layout folder. every things is correct in default module, but when i go to admin module i saw this error (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

this is my bootstrap code that has relation with this error:

$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'
    )));

and this is my modulesetup class:

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')));

}

}

0

2 Answers 2

3

i found the answer : in errorController must put error directory name befor class name ,like error_errorController

Sign up to request clarification or add additional context in comments.

Comments

0

errorControl.php is not available in your controllers folder. if this file will available on their place custom error will show from errorControl.php file .

Main problem is: your code have some error in php file , so that program is searching errorControl.php file . if you will remove error from php file this error will not come.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.