Commit 2bba2a1a authored by Nicolas Widart's avatar Nicolas Widart

Adding a view creator

parent 043c561a
<?php namespace Modules\Core\Composers;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Config;
class SidebarViewCreator
{
public function create($view)
{
$view->prefix = Config::get('core::core.admin-prefix');
$view->items = new Collection;
$view->items->put('dashboard', [
'weight' => 0,
'request' => $view->prefix,
'route' => 'dashboard.index',
'icon-class' => 'fa fa-dashboard',
'title' => 'Dashboard',
]);
}
}
\ No newline at end of file
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
<!-- sidebar menu: : style can be found in sidebar.less --> <!-- sidebar menu: : style can be found in sidebar.less -->
<ul class="sidebar-menu"> <ul class="sidebar-menu">
<?php $items = []; ?>
<?php foreach($items as $i => $item): ?> <?php foreach($items as $i => $item): ?>
<?php if (is_object($item)): ?> <?php if (is_object($item)): ?>
<li class="treeview {{ Request::is($item[0]['request']) ? 'active' : ''}}"> <li class="treeview {{ Request::is($item[0]['request']) ? 'active' : ''}}">
......
<?php
View::creator('core::partials.sidebar-nav', 'Modules\Core\Composers\SidebarViewCreator');
\ No newline at end of file
...@@ -26,4 +26,5 @@ Config::addNamespace('core', __DIR__ . '/Config/'); ...@@ -26,4 +26,5 @@ Config::addNamespace('core', __DIR__ . '/Config/');
*/ */
require __DIR__ . '/Http/routes.php'; require __DIR__ . '/Http/routes.php';
require __DIR__ . '/composers.php';
require __DIR__ . '/helpers.php'; require __DIR__ . '/helpers.php';
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment