08.26 php saved
josoroma
Tags add more
paginate habtm  
Note
josoroma did not leave a note
  1. <?php
  2. class ListingcategoriesController extends AppController {
  3.  
  4.  
  5.  
  6.     var $name      = 'Listingcategories';
  7.  
  8.    
  9.    
  10.     /* ---------------------------------------------------------------------- */
  11.    
  12.    
  13.    
  14.     function index($id = 1) {      
  15.  
  16.         $this->paginate = array(
  17.                                 'fields' => array(
  18.                                     'Listing.id',
  19.                                     'Listing.user_id',
  20.                                     'Listing.name',
  21.                                     'Listing.description',
  22.                                     'Listing.created'
  23.                                 ),
  24.                                 'order' => array(
  25.                                     'Listing.created' => 'DESC'
  26.                                 )
  27.                             );
  28.  
  29.         $listings         = $this->paginate('ListingcategoriesListing', array('Listingcategory.id' => $id));
  30.        
  31.        
  32.         $this->set(compact('listings'));
  33.        
  34.        
  35.     }
  36.  
  37.    
  38.  
  39.     /* ---------------------------------------------------------------------- */
Parsed in 0.040 seconds, using GeSHi 1.0.7.14

Modify this Paste