Ejemplo n.º 1
0
 public function __construct(Application $application, Menu $menu)
 {
     /*
     |--------------------------------------------------------------------------
     | Construct the parent
     |--------------------------------------------------------------------------
     |
     | The parent requires us to pass the application container. However some
     | instances are not available in this container, such as config, sessions and
     | the database;
     |
     */
     parent::__construct($application);
     /*
     |--------------------------------------------------------------------------
     | The Permission handler
     |--------------------------------------------------------------------------
     |
     | The parent requires us to pass the application container. However some
     | instances are not available in this container, such as config, sessions and
     | the database;
     |
     */
     $this->permission = $application->createInstance(Authorize\Permission::class);
     /*
     |--------------------------------------------------------------------------
     | Attach custom post Events
     |--------------------------------------------------------------------------
     |
     | This is for adding new actions to the new post button. Actions should be
     | registered before this view is called!
     |
     */
     $loadPostExtensions = new Event("Layout.load.post.extensions");
     $this->observer->trigger($loadPostExtensions);
     $this->view->setData("newactions", $loadPostExtensions->getResult());
     /*
     |--------------------------------------------------------------------------
     | Attach custom events
     |--------------------------------------------------------------------------
     |
     | Lets just go ahead and attach as many hooks as we need which are not
     | executed now,but just tell the framework where to find more functionality
     | when the need arises. for example loading a menu from the database on, when
     | the "Layout.onCompile.menu.data" event is triggered
     |
     */
     $this->observer->attach([$menu, "load"], "Layout.beforeCompile.menu.data");
     //Extend the user menu
     $this->observer->attach([$menu, "extendUserMenu"], "Layout.onCompile.menu.data");
     //Extend the user menu
     $this->observer->attach([$menu, "extendDashboardMenu"], "Layout.onCompile.menu.data");
     //Check has permission
     $this->observer->attach([$menu, "hasPermission"], "Layout.beforeRender.menu.item");
 }
Ejemplo n.º 2
0
 public function __construct(Container $application)
 {
     parent::__construct($application);
 }
Ejemplo n.º 3
0
 public function __construct(Application $application)
 {
     parent::__construct($application);
     $this->view->appendLayoutSearchPath(Provider::getPackageDir() . "layouts/");
 }