예제 #1
0
 public function showAction($id = null, $slug = null)
 {
     $id = $this->filter->sanitize($id, "int");
     $images = array();
     $model = \Models\Interviews::findFirst(array("conditions" => "id = ?1", "bind" => array(1 => "{$id}")));
     $images = $model->getImages();
     $user = $model->owner;
     Tag::setTitle($model->title);
     $this->view->setVar('model', $model);
     $this->view->setVar('images', $images);
     $this->view->setVar('user', $user);
 }
예제 #2
0
 public function loadModel($id)
 {
     $model = \Models\Interviews::findFirst("id = '{$id}'");
     if (!$model) {
         $this->flashSession->error("Интервью не найдена");
         return $this->response->redirect("backend/interviews/index");
     }
     return $model;
 }