Ejemplo n.º 1
0
 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'));
 }
Ejemplo n.º 2
0
 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'));
 }
Ejemplo n.º 3
0
 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')));
 }
Ejemplo n.º 4
0
 public function __construct(Router $router)
 {
     parent::__construct();
     $this->addChild(new DevoriginMenuItem('Accueil', $router->generate('homepage')));
     $this->addChild(new DevoriginMenuItem('Réalisations', $router->generate('portfolio')));
 }
Ejemplo n.º 5
0
 public function testCreateMenuWithItemClass()
 {
     $childClass = 'Bundle\\MenuBundle\\OtherMenuItem';
     $menu = new Menu(null, $childClass);
     $this->assertEquals($childClass, $menu->getChildClass());
 }