lagdo /
ui-builder
| 1 | <?php |
||
| 2 | |||
| 3 | namespace Lagdo\UiBuilder\Builder; |
||
| 4 | |||
| 5 | use Lagdo\UiBuilder\Component\Base; |
||
| 6 | use Lagdo\UiBuilder\Component\Base\MenuItemComponent; |
||
| 7 | |||
| 8 | trait MenuBuilderTrait |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @var string |
||
| 12 | */ |
||
| 13 | protected string $menuComponentClass = ''; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @var string |
||
| 17 | */ |
||
| 18 | protected string $menuItemComponentClass = ''; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @var string |
||
| 22 | */ |
||
| 23 | protected string $breadcrumbComponentClass = ''; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @var string |
||
| 27 | */ |
||
| 28 | protected string $breadcrumbItemComponentClass = ''; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @inheritDoc |
||
| 32 | */ |
||
| 33 | public function menu(...$arguments): Base\MenuComponent |
||
| 34 | { |
||
| 35 | return $this->createComponentOfClass($this->menuComponentClass, $arguments); |
||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 36 | } |
||
| 37 | |||
| 38 | /** |
||
| 39 | * @inheritDoc |
||
| 40 | */ |
||
| 41 | public function menuItem(...$arguments): Base\MenuItemComponent |
||
| 42 | { |
||
| 43 | return $this->createComponentOfClass($this->menuItemComponentClass, $arguments); |
||
| 44 | } |
||
| 45 | |||
| 46 | /** |
||
| 47 | * @inheritDoc |
||
| 48 | */ |
||
| 49 | public function breadcrumb(...$arguments): Base\BreadcrumbComponent |
||
| 50 | { |
||
| 51 | return $this->createComponentOfClass($this->breadcrumbComponentClass, $arguments); |
||
| 52 | } |
||
| 53 | |||
| 54 | /** |
||
| 55 | * @inheritDoc |
||
| 56 | */ |
||
| 57 | public function breadcrumbItem(...$arguments): Base\BreadcrumbItemComponent |
||
| 58 | { |
||
| 59 | return $this->createComponentOfClass($this->breadcrumbItemComponentClass, $arguments); |
||
| 60 | } |
||
| 61 | } |
||
| 62 |