|
|||
|
After migrating to from ZF 1.0.4 to ZF 1.5.0, the controllers in my modules, which extend the controllers in the default module, are unable to load.
My layout: app\default\controllers\IndexController.php: classname IndexController extends BaseController) app\module1\controllers\IndexController (classname Module1_IndexController extends IndexController) This results in:"Class 'IndexController' not found in DIR\module1\controllers\IndexController.php" In my bootstrap I have properly added the controller directory to the frontend controller using. Did something concerning the naming conventions for modules change? It resembles the problem discussed in this thread. Switching back to ZF 1.0.4 solved this issue. Any tips? Last edited by holtkamp : 03-17-2008 at 04:45 PM. |
|
|||
|
Hi,
I am not sure if you have resolved your issue. But what I have done was the following... My dir structure looks like /application/modules/default /application/modules/mod1 I add this line to my bootstrap. In my case, I created an application class to handle just about everything. $frontController->addModuleDirectory($this->module_path); That line will set the root module directory. Thats pretty much all you have to get the controllers and such working. I am having an issue getting the models to work though. I understand it may have something to do with the addModuleDirectory method and it not adding the model directories. I am still trying to figure that one out. Well, I hope that helps. |
|
|||
|
Quote:
Code:
->setControllerDirectory(array( 'default' => './private/default/php/controllers', 'mod1' => './private/mod1/php/controllers', 'mod2' => './private/mod2/php/controllers')) Cheers! |
|
|||
|
I did some trial and error and it seems my bootstrap is configured properly. Suppose I have a module called 'mobile' with an IndexController which extend the IndexController of the default module. This looks like: Code:
class Mobile_IndexController extends IndexController Code:
Fatal error: Class 'IndexController' not found in D:\Development\workspace\application\private\mobile\php\controllers\IndexController.php on line 9 But when I extend another controller from the default module, let's say my LogController, which ONLY exists in my default module, then everything works fine: Code:
class Mobile_IndexController extends LogController The relevant part of my bootstrap is now: Code:
$front = Zend_Controller_Front::getInstance();
$front->->setModuleControllerDirectoryName('php/controllers')
->addModuleDirectory('./private/')
->setParam('noViewRenderer', true)
->throwExceptions(true);
try {
$front->dispatch();
} catch (Exception $e) {
// log or display exceptions
}
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|