0
votes

How to set the default module in zend 1.* ?

my code in appilication.ini

resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.frontController.defaultModule = "agency"

Error :

Fatal error: Uncaught exception 'Zend_Application_Bootstrap_Exception' with message 'No default controller directory registered with front controller' in D:\Hicham2016\rentcar\vendor\zendframework\zendframework1\library\Zend\Application\Bootstrap\Bootstrap.php on line 99

1
I would open D:\Hicham2016\rentcar\vendor\zendframework\zendframework1\library\Zend\Application\Bootstrap\Bootstrap.php and look at the source to see where it's looking. Better yet -- don't know if this is an option for you or not -- forget ZF1 and use ZF2 instead. Especially if this is a new project. - David

1 Answers

0
votes

First try

resources.frontcontroller.controllerDirectory = APPLICATION_PATH "/controllers"

and maybe you also have to set:

resources.frontController.controllerDirectory = APPLICATION_PATH "/modules/agency/controllers"
resources.frontController.defaultControllerName = "default"
resources.frontController.defaultAction = "home"
  • "defaultControllerName" correspondes to DefaultController.php
  • "defaultAction" to homeAction().

If that does not work try to override the constructor of the agency module bootstrap

public function __construct($application)
{
    parent::__construct($application);
    $frontController = Zend_Controller_Front::getInstance();
    $frontController->addControllerDirectory(__DIR__ . '/controllers', 'agency');
}

Reference