Ok, ok, ok. I'm not trying to make a new record for most latest posts on zfforum. I just keep search for questions that don't have an easy answer somerwhere. So hopefully asking here will help someone else out...
I have a custom routes.ini file setup. I removed all the routing in zend, because I only want my specefic routes to have access.
Errors route normally and so do my custom routes. Everything works fine until I try to use the helper redirector tool.
Code:
$this->_helper->redirector('index', 'index');
This producs the following error:
Message: Route default is not defined
My routes.ini file has been trimmed down to show the basic format:
Code:
[production]
routes.main.type = "Zend_Controller_Router_Route_Static"
routes.main.route = "/"
routes.main.defaults.controller = "index"
routes.main.defaults.action = "index"
yada yada yada
I called this routes.ini config file in my boostrap file with the following function:
Code:
protected function _initRouter(){
$config = new Zend_Config_Ini('routes.ini', 'production');
$front = Zend_Controller_Front::getInstance();
$router = $front->getRouter();
$router->removeDefaultRoutes();
$router->addConfig($config, 'routes');
}
Not that complicated and quite useful if you ask me.
So, how do I define a default route using this method? Or, simply make this error not appear anymore?
Thanks in advance