Example #1
0
 public function missingMethod($parameters = [])
 {
     $this->loadLayout();
     Message::addError("Page not found.");
     compose_section('layouts.default', 'head.title', 'Not found');
     return view('layouts.default');
 }
Example #2
0
 public function getIndex()
 {
     if ($model = $this->validateEntity('store')) {
         $columns = ['Id' => 'id', 'Default' => 'default'];
         $this->loadLayout();
         $new_button = url('backend/store/edit/new');
         compose_section('backend.grid', 'new_button', "<button onclick=\"window.location='{$new_button}';\">Add new store</button>");
         compose_section('backend.grid', 'mass_actions', "<select><option>Action</option></select>");
         return view('backend.grid')->with('title', 'Stores')->with('edit_url', 'backend/store/edit')->with('rows', $model->all($columns))->with('headers', $this->tableHeaders($model, $columns));
     }
     return redirect()->back();
 }
 public function getIndex()
 {
     if ($model = $this->validateEntity('category')) {
         $columns = ['Id' => 'id', 'Category Name' => 'name', 'Last Updated' => 'updated_at'];
         $new_button = url('backend/category/edit/new');
         compose_section('backend.grid', 'new_button', "<button onclick=\"window.location='{$new_button}';\">Add new category</button>");
         compose_section('backend.grid', 'mass_actions', "<select><option>Action</option></select>");
         $this->loadLayout();
         return view('backend.grid')->with('title', 'category')->with('edit_url', 'backend/category/edit')->with('rows', $model->whereNotNull('category_id')->get($columns))->with('headers', $this->tableHeaders($model, $columns));
     }
     return redirect('backend');
 }
Example #4
0
 protected function layouts()
 {
     // Add stylesheets
     compose_section('page.partials.head', 'head.style', ['style' => 'css/util/tabs.css'], ['style' => 'css/util/code.css'], ['style' => 'css/jquery.dataTables.min.css']);
     // Add scripts
     compose_section('page.partials.head', 'head.script', ['script' => 'js/jquery-2.1.3.min.js'], ['script' => 'js/jquery.dataTables.min.js']);
     // Set logo URL
     view()->composer('page.partials.header.logo', function ($view) {
         $view->with('url', url('backend'));
     });
     // Add store selector
     compose_section('page.partials.header', 'header.links.after', ['menu' => 'header.stores']);
 }