public function indexAction() { // action body $medelPage = new Kh_Model_Page(); $where = array('cid' => 2); $aboutPages = $medelPage->getPages($where); $this->view->aboutPages = $aboutPages; }
public function detailAction() { // action body $id = $this->_request->getParam('id'); $modelPage = new Kh_Model_Page(); $page = $modelPage->getPage($id); $this->view->page = $page; //其它新闻文章列表 $where = " id != " . $id; $pages = $modelPage->getPages($where); $this->view->pages = $pages->toArray(); }
public function indexAction() { // action body $modelpage = new Kh_Model_Page(); $where = array('star' => 4, 'top' => 1); $newsStar = $modelpage->fetchRow($where); $this->view->starNews = $newsStar; // $where_list = array( // 'star' => 4, // 'top' => 0 // ); $where_list = '1 = 1'; $order = 'createtime DESC'; $limit = 5; $newsList = $modelpage->getPages($where_list, $order, $limit); $this->view->newsList = $newsList; }