public function __construct(Request $request, Router $router) { parent::__construct(); $this->setCurrentUri($request->getRequestUri()); $this->addChild('Admin', $router->generate('admin')); $this->addChild('Sign out', $router->generate('_security_logout')); $this->setAttributes(array('id' => 'tools-menu', 'class' => 'menu')); }
public function __construct(Request $request, Router $router) { parent::__construct(); $this->setCurrentUri($request->getRequestUri()); $this->addChild('Contacts', $router->generate('contacts')); $this->addChild('Projects', $router->generate('projects')); $this->addChild('Tasks', $router->generate('tasks')); $this->setAttributes(array('id' => 'main-menu', 'class' => 'menu')); }
public function __construct(Router $router) { parent::__construct(); $this->addChild('Home', $router->generate('homepage', array())); $this->addChild('Bundles', $router->generate('bundle_list', array())); $this->addChild('Projects', $router->generate('project_list', array())); $this->addChild('Developers', $router->generate('user_list', array())); $this->addChild('Search', $router->generate('search', array())); $this->addChild('Api', $router->generate('api', array())); $this->addChild('Feed', $router->generate('latest', array('_format' => 'atom'))); }
public function __construct(Router $router) { parent::__construct(); $this->addChild(new DevoriginMenuItem('Accueil', $router->generate('homepage'))); $this->addChild(new DevoriginMenuItem('Réalisations', $router->generate('portfolio'))); }
public function testCreateMenuWithItemClass() { $childClass = 'Bundle\\MenuBundle\\OtherMenuItem'; $menu = new Menu(null, $childClass); $this->assertEquals($childClass, $menu->getChildClass()); }