Ejemplo n.º 1
0
 public function action_showcontent()
 {
     $data = array();
     $id = $this->request->param('id');
     $material = new Model_Material();
     $data = $material->showMaterialById($id);
     if (!$data) {
         throw new HTTP_Exception_404('Запрашиваемая статья не найдена');
         return;
     }
     $this->template->content = View::factory('contentview', $data);
     //Категории для сайдбара
     $tree = new Model_Tree();
     $data_cat = array();
     $data_cat = $tree->getCategoryUrl();
     if (!$data_cat) {
         throw new HTTP_Exception_404('Запрашиваемая категория не найдена');
         return;
     }
     $this->template->categorys = $data_cat;
 }