1 | <?php |
||
11 | class Builder implements BuilderContract |
||
12 | { |
||
13 | use HasAttributes; |
||
14 | |||
15 | /** |
||
16 | * @var Container |
||
17 | */ |
||
18 | protected $container; |
||
19 | |||
20 | /** |
||
21 | * @var Collection |
||
22 | */ |
||
23 | protected $items; |
||
24 | |||
25 | /** |
||
26 | * @var string |
||
27 | */ |
||
28 | protected $name; |
||
29 | |||
30 | /** |
||
31 | * @var string |
||
32 | */ |
||
33 | protected $type; |
||
34 | |||
35 | /** |
||
36 | * @var array |
||
37 | */ |
||
38 | protected $activeAttributes; |
||
39 | |||
40 | /** |
||
41 | * @param Container $container |
||
42 | * @param string $name |
||
43 | * @param string $type |
||
44 | * @param array $attributes |
||
45 | * @param array $activeAttributes |
||
46 | */ |
||
47 | 14 | function __construct(Container $container, $name, $type = self::UL, $attributes = [], $activeAttributes = []) |
|
56 | |||
57 | /** |
||
58 | * @param string $name |
||
59 | * @param callable $itemCallable |
||
60 | * @param callable $menuCallable |
||
61 | * @return Group |
||
62 | */ |
||
63 | 2 | public function group($name, $itemCallable, $menuCallable) |
|
85 | |||
86 | /** |
||
87 | * @param string $name |
||
88 | * @param string $title |
||
89 | * @param string $url |
||
90 | * @param array $attributes |
||
91 | * @param array $linkAttributes |
||
92 | * @param callable|null $callback |
||
93 | * @return Item |
||
94 | */ |
||
95 | 6 | public function add($name, $title, $url, $attributes = [], $linkAttributes = [], $callback = null) |
|
107 | |||
108 | /** |
||
109 | * @param string $name |
||
110 | * @return bool |
||
111 | */ |
||
112 | 2 | public function has($name) |
|
116 | |||
117 | /** |
||
118 | * @param string $name |
||
119 | * @return Item|Group |
||
120 | */ |
||
121 | 2 | public function get($name) |
|
125 | |||
126 | /** |
||
127 | * @return array |
||
128 | */ |
||
129 | 3 | public function all() |
|
133 | |||
134 | /** |
||
135 | * @param string $name |
||
136 | */ |
||
137 | 1 | public function forget($name) |
|
141 | |||
142 | /** |
||
143 | * @return string |
||
144 | */ |
||
145 | 3 | public function getType() |
|
149 | |||
150 | /** |
||
151 | * @param string $type |
||
152 | */ |
||
153 | 1 | public function setType($type) |
|
157 | |||
158 | /** |
||
159 | * @param string|null $view |
||
160 | * @return string |
||
161 | */ |
||
162 | 2 | public function render($view = null) |
|
174 | |||
175 | /** |
||
176 | * @param callable|null $callback |
||
177 | * @return Attributes|mixed |
||
178 | */ |
||
179 | 5 | public function activeAttributes($callback = null) |
|
187 | } |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.