Skip to main content
2 of 2
added 246 characters in body
Mouna Cheikhna
  • 39.8k
  • 10
  • 50
  • 69

You can create a plugin and in routeStartup define something that intercept your request and route /module/controller/action to /action, but for this all your action names must be unique :

 class My_CustomRouterPlugin extends Zend_Controller_Plugin_Abstract { public function routeStartup(Zend_Controller_Request_Abstract $request) { $fc = Zend_Controller_Front::getInstance(); $action =$fc->getRequest()->getActionName(); $router = $fc->getRouter(); $model= new myModel(); $myPage = $model->getPageByAction($action); $route = new Zend_Controller_Router_Route('/action', array( 'module' => $myPage->getModule(); 'controller' => $myPage->getController(); 'action' => $action; )); $router->addRoute($action, $route); return $router; } } 

In myModel define a method can get you an object(or an array) that contains module, controller names (from you DB ).

and register this plugin in your bootstrap:

$front->registerPlugin(new My_CustomRouterPlugin()); 
Mouna Cheikhna
  • 39.8k
  • 10
  • 50
  • 69