1 | <?php |
||
19 | class MenuItem |
||
20 | { |
||
21 | |||
22 | use MethodPropertyAccess, ObjectOptions, FetchesWeight; |
||
23 | |||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | protected $label; |
||
28 | |||
29 | /** |
||
30 | * @var string |
||
31 | */ |
||
32 | protected $link; |
||
33 | |||
34 | /** |
||
35 | * @var array |
||
36 | */ |
||
37 | private $options; |
||
38 | |||
39 | |||
40 | /** |
||
41 | * MenuItem constructor. |
||
42 | * |
||
43 | * @param string $label |
||
44 | * @param string $link |
||
45 | * @param array $options |
||
46 | */ |
||
47 | public function __construct($label, $link, array $options = [ ]) |
||
57 | |||
58 | |||
59 | /** |
||
60 | * Return this menu item's label. |
||
61 | * |
||
62 | * @return string |
||
63 | */ |
||
64 | public function label() |
||
68 | |||
69 | |||
70 | /** |
||
71 | * Return this menu item's link. |
||
72 | * |
||
73 | * @return string |
||
74 | */ |
||
75 | public function link() |
||
79 | |||
80 | |||
81 | /** |
||
82 | * Mark this menu item as the currently active one. |
||
83 | * |
||
84 | * @param string $class |
||
85 | * |
||
86 | * @return \Iatstuti\SimpleMenu\MenuItem |
||
87 | */ |
||
88 | public function active($class = 'active') |
||
94 | } |
||
95 |