Create a controller for rendering menu

This commit is contained in:
Julien Fastré 2013-11-06 17:46:43 +01:00
parent 39244251ce
commit d190d5c371
2 changed files with 22 additions and 1 deletions

View File

@ -0,0 +1,21 @@
<?php
namespace CL\Chill\MainBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class MenuController extends Controller
{
public function writeMenuAction($menu, $layout, $activeRouteKey, array $args = array() )
{
return $this->render($layout, array(
'menu_composer' => $this->get('cl_chill_main_menu_composer'),
'menu' => $menu,
'args' => $args,
'activeRouteKey' => $activeRouteKey
));
}
}

View File

@ -2,7 +2,7 @@ parameters:
# cl_chill_main.example.class: CL\Chill\MainBundle\Example
services:
menu_composer:
cl_chill_main_menu_composer:
class: CL\Chill\MainBundle\DependencyInjection\Services\MenuComposer
arguments:
- "@router"