Skip to content

Commit

Permalink
Merge pull request #1 from cliffordjames/master
Browse files Browse the repository at this point in the history
Add multilevel menu
  • Loading branch information
jeroennoten committed Apr 1, 2016
2 parents a97e8c6 + 509e8f6 commit 218ef3d
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 15 deletions.
40 changes: 39 additions & 1 deletion config/adminlte.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,44 @@
'url' => 'admin/settings',
'icon' => 'lock'
],
[
'text' => 'Multilevel',
'icon' => 'share',
'submenu' => [
[
'text' => 'Level One',
'url' => '#',
],
[
'text' => 'Level One',
'url' => '#',
'submenu' => [
[
'text' => 'Level Two',
'url' => '#',
],
[
'text' => 'Level Two',
'url' => '#',
'submenu' => [
[
'text' => 'Level Three',
'url' => '#',
],
[
'text' => 'Level Three',
'url' => '#',
],
],
],
],
],
[
'text' => 'Level One',
'url' => '#',
],
],
],
],

];
];
16 changes: 2 additions & 14 deletions resources/views/page.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,7 @@

<!-- Sidebar Menu -->
<ul class="sidebar-menu">

@foreach(config('adminlte.menu', []) as $item)
@if (is_string($item))
<li class="header">{{ $item }}</li>
@else
<li>
<a href="{{ url($item['url']) }}">
<i class="fa fa-fw fa-{{ $item['icon'] or 'circle-o' }}"></i>
<span>{{ $item['text'] }}</span>
</a>
</li>
@endif
@endforeach
@each('adminlte::partials.menu-item', config('adminlte.menu', []), 'item')
</ul>
<!-- /.sidebar-menu -->
</section>
Expand Down Expand Up @@ -92,4 +80,4 @@
@section('adminlte_js')
<script src="{{ asset('vendor/adminlte/dist/js/app.min.js') }}"></script>
@yield('js')
@stop
@stop
18 changes: 18 additions & 0 deletions resources/views/partials/menu-item.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
@if (is_string($item))
<li class="header">{{ $item }}</li>
@else
<li {{ isset($item['submenu']) ? 'class="treeview"' : '' }}>
<a href="{{ isset($item['url']) ? url($item['url']) : '#' }}">
<i class="fa fa-fw fa-{{ $item['icon'] or 'circle-o' }}"></i>
<span>{{ $item['text'] }}</span>
@if (isset($item['submenu']))
<i class="fa fa-angle-left pull-right"></i>
@endif
</a>
@if (isset($item['submenu']))
<ul class="treeview-menu">
@each('adminlte::partials.menu-item', $item['submenu'], 'item')
</ul>
@endif
</li>
@endif

0 comments on commit 218ef3d

Please sign in to comment.