public function getEncyclopedieArticle($articleId) { if (empty($articleId)) { throw new Exception("Article id must be filled !"); } $mapper = new Application_Model_Logic_EncyclopedieMapper(); $model = new Application_Model_Logic_Encyclopedie(); if (!$mapper->find($articleId, $model)) { throw new Exception("No article for this id"); } //$model->setTextFr(BBCode_Parser::parse($model->getTextFr())); //$model->setTextEn(BBCode_Parser::parse($model->getTextEn())); //$model->setTextCn(BBCode_Parser::parse($model->getTextCn())); return $model; }
public function afficherAction() { $id = $this->getRequest()->getParam('id'); if (empty($id)) { $this->_redirect('frontend', 'encyclopedie', 'index'); } $this->view->layout = false; $mapper = new Application_Model_Logic_EncyclopedieMapper(); $model = new Application_Model_Logic_Encyclopedie(); $mapper->find($id, $model); $this->view->article = $model->__toArray(); if (!$this->getRequest()->getParam('partial') == 1) { $session = new Zend_Session_Namespace(); $lang = "text_" . $session->locale; $this->view->article['text'] = $this->view->article[$lang]; } unset($this->view->article['text_fr'], $this->view->article['text_en'], $this->view->article['text_cn']); }