I am using the CakePHP pagination helper within my controller as such
$this->paginate = array(
'Entity' => array(
'limit' => $limit,
'order' => $order
)
);
$entities = $this->paginate('Entity', $conditions);
Within my view, I am not using the $paginator variable to display the pagination navigation elements (ie total count, current page, total page...)
My question is: how do I access the $paginator variable from within the controller? I'm assuming it is set after the controller calls the $this->paginate method. I would like to see within the controller the total count of records that the paginate found.
after calling the paginate()
method, the results are stored in $this->params['paging'][YOUR_MODEL_NAME]
To see them:
pr($this->params['paging']);
Cheers
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