/** * @param string $name */ public function setNameAndBrand($name) { $this->name = $name; $this->menu->setBrand($name); }
private function initMenu(Menu $menu) { $menu->add(new ActionMenuItem('Write Post', 'writePost')); $menu->add(new ActionMenuItem('All Posts', 'listPosts')); $menu->add((new MenuGroup('Authors'))->add(new ActionMenuItem('Register Author', MethodActionGenerator::actionId(Authors::class, 'register')))->add(new ActionMenuItem('All Authors', MethodActionGenerator::actionId(Authors::class, 'all')))); return $this; }
private function whenIRenderTheMenu() { $this->rendered = (string) $this->menu->render(); }
private function whenIRenderTheMenu() { $this->rendered = (string) $this->menu->render(new WebRequest(Url::fromString('http://example.com/base'), new Path())); }