Changeset 621 for trunk/app/controllers/news_controller.php
- Timestamp:
- 07/03/08 12:02:14 (5 months ago)
- Files:
-
- 1 modified
-
trunk/app/controllers/news_controller.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/controllers/news_controller.php
r620 r621 19 19 20 20 public $components = array('Portal'); 21 22 public $paginate = array('limit' => 8, 'page' => 1, 'order' => array('News.id' => 'DESC')); 21 23 22 24 public function beforeFilter() … … 26 28 } 27 29 28 public function display( $page=1)30 public function display() 29 31 { 30 $this->layout = 'portal';31 32 $this->pageTitle = 'Karamelo::Home';33 34 $conditions = array("News.status"=>1);35 36 $fields = null;37 38 $order = "News.id DESC";32 $this->layout = 'portal'; 33 34 $this->pageTitle = 'Karamelo::Home'; 35 36 $conditions = array("News.status"=>1); 37 38 $fields = null; 39 40 $order = "News.id DESC"; 39 41 40 $limit = 8; 41 42 $this->set('data', $this->News->findAll($conditions, $fields, $order, $limit)); 43 44 $this->Portal->statics(); // Charge Portal components aka Sidebars 42 $limit = 8; 43 44 //$this->set('data', $this->News->findAll($conditions, $fields, $order, $limit)); 45 $data = $this->paginate('News', array('News.status = 1')); 46 47 $this->set(compact('data')); 48 49 $this->Portal->statics(); // Charge Portal components aka Sidebars 45 50 } 46 51
