I am trying to do pagination from the accommodation controller but with data from the MemberWall model.
here is the code
Accommodation
$data = $this->Accommodation->Member->MemberWall->paginate('MemberWall');
MemberWall
var $paginate = array(
'limit' => 4,
'order' => array(
'MemberWall.created' => 'asc'
)
);
I get this error
SQL Error: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use nea.... Query: paginate
Thanks, Alex
I've tried and it works in both ways:
$this->paginate('MemberWall');
$this->paginate($this->Accommodation->Member->MemberWall);
In my code I use something like;
$this->loadModel('MemberWall');
$this->paginate = array(.....);
$data = $this->paginate('MemberWall');
Here is the REAL answer.
$data = $this->paginate($this->Accommodation->Member->MemberWall);
I had trouble finding this in the docs too. You can actually pass a model object into the paginate method.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With