Beispiel #1
0
 public function __construct()
 {
     parent::__construct();
     $self = $this;
     View::composer('frontend.layout_main', function ($view) use($self) {
         $view->with('moduleName', $this->moduleName);
         $view->with('controllerName', $this->controllerName);
     });
 }
Beispiel #2
0
 /**
  * Setup the layout used by the controller.
  * 
  * param string $layoutName The name of the layout template file
  * @return void
  */
 protected function setupLayout($layoutName = null)
 {
     if (!$layoutName) {
         $layoutName = $this->layout;
     }
     parent::setupLayout($layoutName);
     View::composer($layoutName, function ($view) {
         $view->with('moduleName', $this->moduleName);
         $view->with('controllerName', $this->controllerName);
     });
 }
Beispiel #3
0
 public function __construct()
 {
     parent::__construct();
     $self = $this;
     View::composer('backend.layout_main', function ($view) use($self) {
         /*
          * Contact messages
          */
         $contactMessages = null;
         if (user()->hasAccess('contact', PERM_READ)) {
             $count = DB::table('contact_messages')->where('new', true)->count();
             if ($count > 0) {
                 $contactMessages = link_to('admin/contact', Lang::choice('app.new_messages', $count));
             }
         }
         $view->with('contactMessages', $contactMessages);
         $view->with('moduleName', $this->moduleName);
         $view->with('controllerName', $this->controllerName);
         $view->with('controllerIcon', $this->icon);
     });
 }