adapt layout for person search + standard rendering

This commit is contained in:
2013-10-31 16:13:32 +01:00
parent 0c91b395ca
commit 7d9eeaf15d
6 changed files with 67 additions and 7 deletions

View File

@@ -0,0 +1,41 @@
<?php
namespace CL\Chill\MainBundle\DependencyInjection\Services;
use Symfony\Component\Routing\RouterInterface;
/**
* This class permit to build menu from the routing information
* stored in each bundle.
*
* how to must come here FIXME
*
* @author julien
*/
class MenuComposer {
/**
*
* @var \Symfony\Component\Routing\RouteCollection;
*/
private $routeCollection;
public function __construct(RouterInterface $router) {
$this->routeCollection = $router->getRouteCollection();
}
public function getRoutesFor($menuId, array $parameters = array()) {
$routes = array();
foreach ($this->routeCollection->all() as $key => $route) {
if ($route['options']['menu'] === $menuId) {
$routes[$route['options']['order']] = $route;
}
}
return $routes;
}
}