| @@ 30-37 (lines=8) @@ | ||
| 27 | $link = $item->getLink(); |
|
| 28 | $link->setTitle('Orders'); |
|
| 29 | $link->setUrl('javascript:;'); |
|
| 30 | }, function(Builder $menu) { |
|
| 31 | $menu->create('all', 'All', url('/orders/all')); |
|
| 32 | $menu->create('type_1', 'Type 1', url('/orders/1'), [], ['class' => 'text-color-red']); |
|
| 33 | ||
| 34 | $menu->create('type_2', 'Type 2', url('/orders/2'), [], [], function(Item $item) { |
|
| 35 | $item->getLink()->getAttributes()->push(['data-attribute' => 'value']); |
|
| 36 | }); |
|
| 37 | }); |
|
| 38 | ||
| 39 | return $builder; |
|
| 40 | } |
|
| @@ 164-171 (lines=8) @@ | ||
| 161 | $link->setTitle('Orders'); |
|
| 162 | $link->setUrl('javascript:;'); |
|
| 163 | ||
| 164 | }, function(Builder $menu) { |
|
| 165 | $menu->create('all', 'All', url('/orders/all')); |
|
| 166 | $menu->create('type_1', 'Type 1', url('/orders/1'), [], ['class' => 'text-color-red']); |
|
| 167 | ||
| 168 | $menu->create('type_2', 'Type 2', url('/orders/2'), [], [], function(Item $item) { |
|
| 169 | $item->getLink()->getAttributes()->push(['data-attribute' => 'value']); |
|
| 170 | }); |
|
| 171 | }); |
|
| 172 | ||
| 173 | $html = $builder->render(); |
|
| 174 | $file = file_get_contents(__DIR__ . '/stub/menu.html'); |
|