kamikaze_pilot
kamikaze_pilot

Reputation: 14834

get a list of defined zend routes

so you can add routes in zend framework with Zend Router's addRoute() method...

but what if I want to get a list of all the defined routes? is there a method that I can use to do so?

Upvotes: 5

Views: 2319

Answers (2)

Kees Schepers
Kees Schepers

Reputation: 2248

If you are using the Rewrite routing you can call getRoutes() in Zend_Controller_Router_Rewrite. This will give you an array of all chained routes.

Upvotes: 5

Mandy Schoep
Mandy Schoep

Reputation: 981

In Zend Framework 1.11 you can get the router from the Front Controller like this:

$router = Zend_Controller_Front::getInstance()->getRouter();

You can get the routes with the getRoutes method:

$routes = $router->getRoutes();

Upvotes: 0

Related Questions