28 lines
886 B
PHP
28 lines
886 B
PHP
<?php
|
|
/**
|
|
* @var array $menu
|
|
*/
|
|
?>
|
|
<ul class="list-unstyled components mb-5">
|
|
<?php foreach ($menu as $item):
|
|
$child = \kernel\models\Menu::getChild($item->id);
|
|
if ($child): ?>
|
|
<li>
|
|
<a href="#item<?=$item->id?>" data-toggle="collapse" aria-expanded="false" class="dropdown-toggle"><?= $item->label ?></a>
|
|
<ul class="collapse list-unstyled" id="item<?=$item->id?>">
|
|
<?php foreach ($child as $subitem): ?>
|
|
<li>
|
|
<a href="<?= $subitem->url ?>"><?= $subitem->label ?></a>
|
|
</li>
|
|
<?php endforeach; ?>
|
|
</ul>
|
|
</li>
|
|
<?php else: ?>
|
|
<li>
|
|
<a href="<?= $item->url ?>"><?= $item->label ?></a>
|
|
</li>
|
|
<?php endif; ?>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
</ul>
|