Changeset 621
- Timestamp:
- 07/03/08 12:02:14 (3 months ago)
- Location:
- trunk/app
- Files:
-
- 2 modified
-
controllers/news_controller.php (modified) (2 diffs)
-
views/news/display.ctp (modified) (1 diff)
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 -
trunk/app/views/news/display.ctp
r620 r621 51 51 echo '</div>'; 52 52 endforeach; 53 54 $t = $html->div(null,$paginator->prev('« Previous ',null,null,array('class'=>'disabled')),array('style'=>'width:100px;float:left')); 55 $t .= $html->div(null, $paginator->next(' Next »', null, null, array('class' => 'disabled')),array('style'=>'width:100px;float:right')); 56 $t .= $html->div(null,$paginator->counter(), array('style'=>'width:200px;float:center')); 57 echo $html->div(null,$t, array('style'=>'font-size:9pt;width:400px;margin:15px auto;')); 53 58 ?>
