示例#1
0
 /**
  * Initialize the controller.
  *
  * @return  $this
  *
  * @since   1.0
  */
 public function initialize()
 {
     parent::initialize();
     $this->getContainer()->get('app')->getUser()->authorize('admin');
     $this->view->setItem($this->model->getItem($this->getContainer()->get('app')->input->getInt('id')));
 }
示例#2
0
 /**
  * Initialize the controller.
  *
  * This will set up default model and view classes.
  *
  * @return  $this  Method supports chaining
  *
  * @since   1.0
  * @throws  \RuntimeException
  */
 public function initialize()
 {
     parent::initialize();
     $this->view->setItem(new ArticlesTable($this->getContainer()->get('db')));
 }