linkyndy
linkyndy

Reputation: 17900

CakePHP PaginatorHelper: get current page

I need the page number but cannot seem to find any documentation towards it. How do I output in my CakePHP view the current page I am on (using PaginatorHelper)?

Thank you!

Upvotes: 2

Views: 6305

Answers (2)

Niwat Panrit
Niwat Panrit

Reputation: 11

After extracted $this->request via pr(), I got this solution

$currentPage = $this->request->paging['Model']['page']

and to put it to view $this->set('currentPage', $currentPage)

Upvotes: 1

mmhan
mmhan

Reputation: 731

$this->Paginator->current($model = null)

http://api.cakephp.org/class/paginator-helper#method-PaginatorHelpercurrent

Upvotes: 4

Related Questions