Redeclare Paginate var in function | CakePHP


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. //override pagination variable for custom pagination that adds distance
  2. $this->paginate = array('limit' => 10,
  3. 'fields' => array('Location.lat','Location.long'),
  4. 'order' => array('distance' => 'ASC'));
  5.  
  6. $this->set('locations', $this->paginate('Location', $conditions));

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.