- protected function _initFrontControllerConfiguration()
- {
- $this->bootstrap('FrontController');
- $front = $this->getResource('FrontController');
- $front->registerPlugin(new Zend_Controller_Plugin_ErrorHandler(array(
- 'module' => 'default',
- 'controller' => 'error',
- 'action' => 'error'
- )));
- $front->setDefaultModule('index');
- $front->setDefaultControllerName('index');
- $front->setDefaultAction('index');
- $front->setParam('prefixDefaultModule', true);
- // Inits instance of Zend_Controller_Framework
- $ctrl = Zend_Controller_Front::getInstance();
- // Gets default router
- $router = $ctrl->getRouter();
- // Gets all valid routes, auto-created by control panel
- // This routes are not standart, not dispatched by default
- // rule :module/:controller/:action/*
- $validRoutes = new Zend_Config_Xml(APPLICATION_PATH . '/configs/routing/routes.xml', null);
- // Adds this routes to router
- foreach ($validRoutes as $validRoute) {
- $routeName = $validRoute->defaults->module[0] . '_';
- $routeName .= str_replace('/', '', rtrim($validRoute->route, '/'));
- $router->addRoute(
- $routeName,
- new Zend_Controller_Router_Route(
- $validRoute->route . '*',
- $validRoute->defaults->toArray()
- )
- );
- }
Undefined
By: Guest | Date: Mar 26 2010 10:01 | Format: None | Expires: never | Size: 1.4 KB | Hits: 881
Latest pastes
18 hours ago
1 days ago
1 days ago
1 days ago
2 days ago