| | |
| | | return $this->id; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Add a menu item |
| | | * |
| | | * @param string|null $text |
| | | * @param string|null $icon |
| | | * @return MenuItem |
| | | */ |
| | | public function addItem(?string $text = null, ?string $icon = null): MenuItem { |
| | |
| | | private ?string $icon = null; |
| | | private ?Navigation $submenu = null; |
| | | private array $classes = []; |
| | | private array $menuClasses = []; |
| | | private array $attributes = []; |
| | | private array $attributes = []; |
| | | private bool $current = false; |
| | | |
| | | public function __construct(int $id) { |
| | |
| | | $this->current = $current; |
| | | if ($current) { |
| | | $this->addClass('current'); |
| | | $this->attribute('aria-current', 'page'); |
| | | } |
| | | return $this; |
| | | } |