Closed Shokhrukh2606 closed 4 years ago
Please provide an example showing the error.
It shows any errors on console, but not opening And array passed to menu widget:
[
'label' => 'Same tools',
'icon' => 'fa fa-share',
'url' => '#',
'options'=>['class'=>'treeview'],
'items' => [
[
'label' => 'Level One',
'icon' => 'fa fa-circle-o',
'url' => '#',
],
[
'label' => 'Level One',
'icon' => 'fa fa-circle-o',
'url' => '#',
],
],
]
Which version do you use?
Did you try the example views? https://github.com/dmstr/yii2-adminlte-asset/blob/master/example-views/yiisoft/yii2-app/layouts/left.php#L12
I am using version ~2.3.0, I also tried example that you gave but didn't work
I tried to use as example in pages it worked properly
<ul class="sidebar-menu" data-widget="tree">
<li class="header">MAIN NAVIGATION</li>
<?php foreach ($menu as $item) {
if (isset($item['items'])) { ?>
<li class="treeview">
<a href="#">
<i class="<?=$item['icon']?>"></i> <span><?= $item['label'] ?></span>
<span class="pull-right-container">
<i class="fa fa-angle-left pull-right"></i>
</span>
</a>
<ul class="treeview-menu">
<?php foreach ($item['items'] as $child) { ?>
<li><a href="<?=Url::to($child['url'])?>"><i class="<?=$child['icon']?>"></i> <?=$child['label']?></a></li>
<?php } ?>
</ul>
</li>
<?php } else {
$icon=HTML::tag('i','',['class'=>(isset($item['icon'])) ? $item['icon'] : '']);
echo Html::tag('li', Html::a($icon.$item['label'], (isset($item['url'])) ? $item['url'] : ''));
// echo Html::tag('li', Html::a($item['label'], (isset($item['url']))?$item['url']:'' ), (isset($item['options']))?$item['options']:'');
}
} ?>
</ul>
but it is a bit hard-coded. Is it correct, if correct you can close this issue))
I have installed your plugin but multilevel list not opening can you help, please?