Domanda

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?

È stato utile?

Soluzione

This solves everything!

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

Posting the answer if someone else needs it.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top