/** * Initialize the controller. * * This will set up default model and view classes. * * @return $this Method allows chaining * * @since 1.0 * @throws \RuntimeException */ public function initialize() { parent::initialize(); $this->getContainer()->get('app')->getUser()->authorize('admin'); $this->model->setUser($this->getContainer()->get('app')->getUser()); }
/** * Method to render the view. * * @return string The rendered view. * * @since 1.0 * @throws \RuntimeException */ public function render() { $this->renderer->set('projects', $this->model->getItems()); return parent::render(); }
/** * Initialize the controller. * * This will set up default model and view classes. * * @return $this Method allows chaining * * @since 1.0 * @throws \RuntimeException */ public function initialize() { parent::initialize(); $this->model->setUser($this->getContainer()->get('app')->getUser()); return $this; }