Reverted to Symfony 2.0's signature, which made it simple to display only a subset of the routes of the application.

This is particularly useful for FOSJsRoutingBundle's fos:js-routing:debug command, which allows to filter the list of javascript-exposed routes.
This commit is contained in:
Xavier Lacot 2012-06-28 18:29:35 +02:00
parent 884a8264b3
commit e44e21c2e9

View File

@ -74,11 +74,13 @@ EOF
}
}
protected function outputRoutes(OutputInterface $output)
protected function outputRoutes(OutputInterface $output, $routes = null)
{
$routes = array();
foreach ($this->getContainer()->get('router')->getRouteCollection()->all() as $name => $route) {
$routes[$name] = $route->compile();
if (null === $routes) {
$routes = array();
foreach ($this->getContainer()->get('router')->getRouteCollection()->all() as $name => $route) {
$routes[$name] = $route->compile();
}
}
$output->writeln($this->getHelper('formatter')->formatSection('router', 'Current routes'));