1 | <?php |
||
11 | class Builder implements BuilderContract |
||
12 | { |
||
13 | use HasAttributes; |
||
14 | |||
15 | /** |
||
16 | * @var Container |
||
17 | */ |
||
18 | protected $container; |
||
19 | |||
20 | /** |
||
21 | * @var array |
||
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 Attributes |
||
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 | public function __construct(Container $container, $name, $type = self::UL, $attributes = [], $activeAttributes = []) |
|
56 | |||
57 | /** |
||
58 | * @param string $name |
||
59 | * @param \Closure $itemCallable |
||
60 | * @param \Closure $menuCallable |
||
61 | * @return Group |
||
62 | */ |
||
63 | 2 | public function group($name, \Closure $itemCallable, \Closure $menuCallable) |
|
80 | |||
81 | /** |
||
82 | * @param string $name |
||
83 | * @param string $title |
||
84 | * @param string $url |
||
85 | * @param array $attributes |
||
86 | * @param array $linkAttributes |
||
87 | * @param \Closure|null $callback |
||
88 | * @return Item |
||
89 | */ |
||
90 | 6 | public function add($name, $title, $url, $attributes = [], $linkAttributes = [], $callback = null) |
|
102 | |||
103 | /** |
||
104 | * @param string $name |
||
105 | * @return bool |
||
106 | */ |
||
107 | 4 | public function has($name) |
|
111 | |||
112 | /** |
||
113 | * @param string $name |
||
114 | * @param mixed|null $default |
||
115 | * @return Item|Group|null |
||
116 | */ |
||
117 | 2 | public function get($name, $default = null) |
|
124 | |||
125 | /** |
||
126 | * @return array |
||
127 | */ |
||
128 | 3 | public function all() |
|
132 | |||
133 | /** |
||
134 | * @param string $name |
||
135 | */ |
||
136 | 1 | public function forget($name) |
|
142 | |||
143 | /** |
||
144 | * @return string |
||
145 | */ |
||
146 | 3 | public function getType() |
|
150 | |||
151 | /** |
||
152 | * @param string $type |
||
153 | */ |
||
154 | 1 | public function setType($type) |
|
158 | |||
159 | /** |
||
160 | * @param string|null $view |
||
161 | * @return string |
||
162 | */ |
||
163 | 2 | public function render($view = null) |
|
182 | |||
183 | /** |
||
184 | * @param \Closure|null $callback |
||
185 | * @return Attributes|mixed |
||
186 | */ |
||
187 | 5 | public function activeAttributes($callback = null) |
|
195 | |||
196 | 2 | protected function minifyHtmlOutput($html) |
|
212 | } |