5

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?

j0k
  • 22,600
  • 28
  • 79
  • 90
kamikaze_pilot
  • 14,304
  • 35
  • 111
  • 171

2 Answers2

5

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.

Mandy Schoep
  • 942
  • 11
  • 19
Kees Schepers
  • 2,248
  • 1
  • 20
  • 31
0

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();
Mandy Schoep
  • 942
  • 11
  • 19