Assume you are on a LogsController which has Log as the default model and wanted to paginate another model LogColumn. Here’s How it goes:
$this->paginate = array(
‘LogColumn’ => array(
‘limit’ => 20,
‘recursive’ => 0,
‘model’ => ‘LogColumn’,
‘order’ => array(‘LogColumn.id’ => ‘ASC’)
Now make the call with the options set already.
$log_columns = $this->Paginator->paginate(‘LogColumn’, array(‘LogColumn.log_id’=>$log_id));
Hello Friends, I’m Arvind Kumar, founder of Inimist Technologies, Inimist Academy, The Fundabook and many more. I am a Full Stack Web Developer and Programmer by heart, and a Hindi/English blogger by chance. I build Web and Mobile Application around React, VueJS, NodeJS and PHP frameworks.
Have a project in mind? Get in touch