public function before() { if (!class_exists('\\Parsedown')) { throw new Exception('Markdown parser not found. Live documentation will not work in your environment.'); } parent::before(); }
/** * Execute on controller execute * return void */ public function boot() { parent::boot(); if (auth()->check()) { // Разрешение пользователю править свой профиль $action = $this->getCurrentAction(); if (in_array($action, ['getEdit', 'postEdit']) and $this->currentUser->id == $this->getRouter()->getCurrentRoute()->getParameter('id')) { $this->allowedActions[] = $action; } } }
public function before() { parent::before(); $this->collection = $this->getCollection(); $this->sectionPrefix = $this->getSectionPrefix(); }
public function checkAccess($page) { if (!in_array($this->getCurrentAction(), $this->allowedActions)) { parent::checkAccess($page); } }