Show
Ignore:
Timestamp:
07/03/08 12:02:14 (5 months ago)
Author:
aarkerio
Message:

Update news

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/app/controllers/news_controller.php

    r620 r621  
    1919   
    2020 public $components       = array('Portal'); 
     21 
     22 public $paginate = array('limit' => 8, 'page' => 1, 'order' => array('News.id' => 'DESC')); 
    2123   
    2224 public function beforeFilter()  
     
    2628 } 
    2729  
    28  public function display($page=1)  
     30 public function display()  
    2931 {      
    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"; 
    3941                     
    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 
    4550 } 
    4651