Question

Is it possible from a controller to get the routes to all other controllers? What I need is to fetch the "/customer/:customer_id/" path.

I have scanned the controller folder so I know the names of all my controllers.

Any suggestions?

Was it helpful?

Solution

This solves everything!

$router = Zend_Controller_Front::getInstance()->getRouter();
$route =  $router->getRoute($controllerName);
$route->getRouteUri();

Posting the answer if someone else needs it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top