Hi,
I cant get the paginate to display with a condition,
I have checked the docs and other posts and cant see what I have done wrong.
I dont get an error but just no output
if (isset($this->request->query['address_suburb'])) {
$suburb=$this->request->query['address_suburb'];
debug($suburb);
// 'conditions'=>array('Student.address_suburb LIKE' => $suburb),
$this->paginate = array(
'conditions'=>array('Student.address_suburb LIKE' => '%'.$suburb),
'limit' => 3,
'order' => array('Student.id' => 'ASC','Student.first_name' => 'ASC'),
'contain' => array('TutoringType','Referral')
);
$myval= $this->set('students', $this->paginate());
debug($myval);
}
else
$suburb=null;
$this->set('suburb', $suburb);
-- I cant get the paginate to display with a condition,
I have checked the docs and other posts and cant see what I have done wrong.
I dont get an error but just no output
if (isset($this->request->query['address_suburb'])) {
$suburb=$this->request->query['address_suburb'];
debug($suburb);
// 'conditions'=>array('Student.address_suburb LIKE' => $suburb),
$this->paginate = array(
'conditions'=>array('Student.address_suburb LIKE' => '%'.$suburb),
'limit' => 3,
'order' => array('Student.id' => 'ASC','Student.first_name' => 'ASC'),
'contain' => array('TutoringType','Referral')
);
$myval= $this->set('students', $this->paginate());
debug($myval);
}
else
$suburb=null;
$this->set('suburb', $suburb);
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment