@@ -1,7 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace Malezha\Menu\Tests; |
| 3 | 3 | |
| 4 | -use Illuminate\Contracts\Container\Container; |
|
| 5 | 4 | use Malezha\Menu\Contracts\Attributes; |
| 6 | 5 | use Malezha\Menu\Contracts\Builder; |
| 7 | 6 | use Malezha\Menu\Contracts\Item; |
@@ -1,18 +1,18 @@ |
||
| 1 | 1 | <div class="div-menu"> |
| 2 | 2 | <?php if ($menu) :?> |
| 3 | - <<?=$menu->getType() . $menu->buildAttributes();?>> |
|
| 3 | + <<?=$menu->getType() . $menu->buildAttributes(); ?>> |
|
| 4 | 4 | <?php foreach ($menu->all() as $element) :?> |
| 5 | - <?php $isGroup = $element instanceof \Malezha\Menu\Contracts\Group;?> |
|
| 6 | - <?php if ($isGroup) $item = $element->getItem(); else $item = $element;?> |
|
| 5 | + <?php $isGroup = $element instanceof \Malezha\Menu\Contracts\Group; ?> |
|
| 6 | + <?php if ($isGroup) $item = $element->getItem(); else $item = $element; ?> |
|
| 7 | 7 | <?php if ($item->canDisplay()) :?> |
| 8 | - <li<?=$item->buildAttributes();?>> |
|
| 9 | - <a href="<?=$item->getLink()->getUrl();?>"<?=$item->getLink()->buildAttributes();?>> |
|
| 10 | - <?=$item->getLink()->getTitle();?> |
|
| 8 | + <li<?=$item->buildAttributes(); ?>> |
|
| 9 | + <a href="<?=$item->getLink()->getUrl(); ?>"<?=$item->getLink()->buildAttributes(); ?>> |
|
| 10 | + <?=$item->getLink()->getTitle(); ?> |
|
| 11 | 11 | </a> |
| 12 | - <?php if ($isGroup) echo $element->getMenu()->render($renderView);?> |
|
| 12 | + <?php if ($isGroup) echo $element->getMenu()->render($renderView); ?> |
|
| 13 | 13 | </li> |
| 14 | - <?php endif;?> |
|
| 15 | - <?php endforeach;?> |
|
| 16 | - </<?=$menu->getType();?>> |
|
| 17 | - <?php endif;?> |
|
| 14 | + <?php endif; ?> |
|
| 15 | + <?php endforeach; ?> |
|
| 16 | + </<?=$menu->getType(); ?>> |
|
| 17 | + <?php endif; ?> |
|
| 18 | 18 | </div> |
| 19 | 19 | \ No newline at end of file |
@@ -3,13 +3,21 @@ |
||
| 3 | 3 | <<?=$menu->getType() . $menu->buildAttributes();?>> |
| 4 | 4 | <?php foreach ($menu->all() as $element) :?> |
| 5 | 5 | <?php $isGroup = $element instanceof \Malezha\Menu\Contracts\Group;?> |
| 6 | - <?php if ($isGroup) $item = $element->getItem(); else $item = $element;?> |
|
| 6 | + <?php if ($isGroup) { |
|
| 7 | + $item = $element->getItem(); |
|
| 8 | +} else { |
|
| 9 | + $item = $element; |
|
| 10 | +} |
|
| 11 | +?> |
|
| 7 | 12 | <?php if ($item->canDisplay()) :?> |
| 8 | 13 | <li<?=$item->buildAttributes();?>> |
| 9 | 14 | <a href="<?=$item->getLink()->getUrl();?>"<?=$item->getLink()->buildAttributes();?>> |
| 10 | 15 | <?=$item->getLink()->getTitle();?> |
| 11 | 16 | </a> |
| 12 | - <?php if ($isGroup) echo $element->getMenu()->render($renderView);?> |
|
| 17 | + <?php if ($isGroup) { |
|
| 18 | + echo $element->getMenu()->render($renderView); |
|
| 19 | +} |
|
| 20 | +?> |
|
| 13 | 21 | </li> |
| 14 | 22 | <?php endif;?> |
| 15 | 23 | <?php endforeach;?> |
@@ -103,7 +103,7 @@ |
||
| 103 | 103 | |
| 104 | 104 | protected function registerRenderSystem() |
| 105 | 105 | { |
| 106 | - $this->app->bind('menu.render', function (Container $app) { |
|
| 106 | + $this->app->bind('menu.render', function(Container $app) { |
|
| 107 | 107 | $config = $app['config']->get('menu'); |
| 108 | 108 | $key = $config['template-system']; |
| 109 | 109 | $available = $config['available-template-systems']; |
@@ -1,16 +1,16 @@ |
||
| 1 | 1 | <?php if ($menu) :?> |
| 2 | - <<?=$menu->getType() . $menu->buildAttributes();?>> |
|
| 2 | + <<?=$menu->getType() . $menu->buildAttributes(); ?>> |
|
| 3 | 3 | <?php foreach ($menu->all() as $element) :?> |
| 4 | - <?php $isGroup = $element instanceof \Malezha\Menu\Contracts\Group;?> |
|
| 5 | - <?php if ($isGroup) $item = $element->getItem(); else $item = $element;?> |
|
| 4 | + <?php $isGroup = $element instanceof \Malezha\Menu\Contracts\Group; ?> |
|
| 5 | + <?php if ($isGroup) $item = $element->getItem(); else $item = $element; ?> |
|
| 6 | 6 | <?php if ($item->canDisplay()) :?> |
| 7 | - <li<?=$item->buildAttributes();?>> |
|
| 8 | - <a href="<?=$item->getLink()->getUrl();?>"<?=$item->getLink()->buildAttributes();?>> |
|
| 9 | - <?=$item->getLink()->getTitle();?> |
|
| 7 | + <li<?=$item->buildAttributes(); ?>> |
|
| 8 | + <a href="<?=$item->getLink()->getUrl(); ?>"<?=$item->getLink()->buildAttributes(); ?>> |
|
| 9 | + <?=$item->getLink()->getTitle(); ?> |
|
| 10 | 10 | </a> |
| 11 | - <?php if ($isGroup) echo $element->getMenu()->render($renderView);?> |
|
| 11 | + <?php if ($isGroup) echo $element->getMenu()->render($renderView); ?> |
|
| 12 | 12 | </li> |
| 13 | - <?php endif;?> |
|
| 14 | - <?php endforeach;?> |
|
| 15 | - </<?=$menu->getType();?>> |
|
| 16 | -<?php endif;?> |
|
| 17 | 13 | \ No newline at end of file |
| 14 | + <?php endif; ?> |
|
| 15 | + <?php endforeach; ?> |
|
| 16 | + </<?=$menu->getType(); ?>> |
|
| 17 | +<?php endif; ?> |
|
| 18 | 18 | \ No newline at end of file |
@@ -2,13 +2,21 @@ |
||
| 2 | 2 | <<?=$menu->getType() . $menu->buildAttributes();?>> |
| 3 | 3 | <?php foreach ($menu->all() as $element) :?> |
| 4 | 4 | <?php $isGroup = $element instanceof \Malezha\Menu\Contracts\Group;?> |
| 5 | - <?php if ($isGroup) $item = $element->getItem(); else $item = $element;?> |
|
| 5 | + <?php if ($isGroup) { |
|
| 6 | + $item = $element->getItem(); |
|
| 7 | +} else { |
|
| 8 | + $item = $element; |
|
| 9 | +} |
|
| 10 | +?> |
|
| 6 | 11 | <?php if ($item->canDisplay()) :?> |
| 7 | 12 | <li<?=$item->buildAttributes();?>> |
| 8 | 13 | <a href="<?=$item->getLink()->getUrl();?>"<?=$item->getLink()->buildAttributes();?>> |
| 9 | 14 | <?=$item->getLink()->getTitle();?> |
| 10 | 15 | </a> |
| 11 | - <?php if ($isGroup) echo $element->getMenu()->render($renderView);?> |
|
| 16 | + <?php if ($isGroup) { |
|
| 17 | + echo $element->getMenu()->render($renderView); |
|
| 18 | +} |
|
| 19 | +?> |
|
| 12 | 20 | </li> |
| 13 | 21 | <?php endif;?> |
| 14 | 22 | <?php endforeach;?> |