コード例 #1
0
     // Data
     $news = $newsDb->getAllWithDescById($id, $this->_languageId);
     //        $author = $newsDb->getAuthor($id,$this->_languageId)->toArray();
     //        $authorName = (empty($author))? '' : $author['name'];
     //if content is empty, will be redirecting to list of news
     if ($news['content']) {
         //update viewer
         //hanya increamen 1 saja setiap kali content detaul di load
         //            $newsDb->updateField($id,array('viewer'=>$news['viewer']+1));
         // View
         $this->view->news = $news;
         $this->view->id = $id;
         //            $this->view->author = $authorName;
     } else {
         $this->_redirector->gotoUrl($this->view->baseUrl('/news/index/'));
     }
 }
 /**
  * IS : -
  * FS : -
  * Desc : controller untuk ! form
  */
 /**
  * IS: -
  * FS: -
  * Desc: Fungsi untuk generate RSS
  */
 public function rssAction()
 {
     // Tidak pake layout
     //$this->getResponse()->setHeader('Content-Type', 'text/xml');
     $this->_helper->layout->disableLayout();
     // Model
     $newsDb = new Model_DbTable_News();