Paolo Casarini schreef:
Hi,
I'm working with the 2282 revision of the framework and I'm trying
to use the RewriteRouter with the 'useModules' param set to true.
My index.php is:
-----------------------
$config = Zend::registry('config');
$router = new Zend_Controller_RewriteRouter(array('useModules' => true));
$ctrl = Zend_Controller_Front::getInstance();
$ctrl->setRouter($router);
$ctrl->setControllerDirectory($config->zf->controllerDirectory);
$ctrl->setBaseUrl($config->webhost->baseurl);
$response = $ctrl->dispatch();
-----------------------
My controllers dir is
\Application
\Controllers
IndexController.php // echo "Welcome on IndexController"
\Main
IndexController.php // echo "Welcome on MainController"
With the URL http://my.space.com/ the output is 'Welcome on
IndexController'.
With the URL http://my.space.com/main/index the output is
"Fatal error: Maximum execution time of 180 seconds exceeded in
/home/devel/enabu/library/Zend/Controller/Dispatcher.php on line 563"
Where I'm wrong?
Thanx,
Paolo.
Hello,
Looking at your above code, it looks like you are only setting a single
controller path:
$ctrl->setControllerDirectory($config->zf->controllerDirectory);
If you work with the modular approach and your controllers are stored in
multiple folders, you should provide an array with controllers, where the key
is the name of the module.
eg: $modules = array(
'front' => './application/controllers',
'back' => './application/controllers/back/'
);
$Controller->setControllerDirectory($modules); // FIFO
However, I don't understand why you are ending up with the fatal error?
--
Andries Seutens
http://andries.systray.be
i18n Locale Team is looking for your help. Volunteers are always welcome to
contribute their feedback, bug fixes, suggestions for enhancements and
improvements, experimental patches, and especially their ideas on the fw-i18n
mail list.
Are you enjoying the wiki manual? They are frequently updated and incubator
documentation is also included!
Live manual: http://framework.zend.com/wiki/display/ZFDOCDEV
Incubator manual: http://framework.zend.com/wiki/display/ZFDOC