menu() public method

Output a menu.
public menu ( Twig_Environment $env, string $identifier = '', string $template = '_sub_menu.twig', array $params = [], boolean $safe ) : string | null
$env Twig_Environment
$identifier string Identifier for a particular menu
$template string The template to use.
$params array Extra parameters to pass on to the menu template.
$safe boolean
return string | null
Beispiel #1
0
 public function testMenuMain()
 {
     $app = $this->getApp();
     $request = Request::createFromGlobals();
     $app['request'] = $request;
     $app['request_stack']->push($request);
     $handler = new HtmlHandler($app);
     $result = $handler->menu($app['twig'], 'main', '_sub_menu.twig', ['kitten' => 'fluffy'], false);
     $this->assertRegExp('#<li class="index-1 first">#', $result);
 }