Reputation: 197
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.
Upvotes: 5
Views: 4324
Reputation: 20102
after calling the paginate()
method, the results are stored in $this->params['paging'][YOUR_MODEL_NAME]
To see them:
pr($this->params['paging']);
Cheers
Upvotes: 14