Ejemplo n.º 1
0
 /**
  * view action for article controller
  * @throws Exception
  */
 public function viewAction()
 {
     // action body
     try {
         $translate = Zend_Registry::get('Zend_Translate');
         $mdlArticle = new Content_Model_Article();
         $id = $this->getRequest()->getParam('aid', 0);
         $article = $mdlArticle->find(intval($id))->current();
         if (!$article) {
             throw new Exception($translate->translate("LBL_ROW_NOT_FOUND"));
         }
         $this->view->article = $article;
     } catch (Exception $e) {
         $this->_helper->flashMessenger->addMessage(array('type' => 'error', 'header' => '', 'message' => $e->getMessage()));
         $this->_helper->redirector("error", "error", "default");
     }
     return;
 }