mrdaliri
mrdaliri

Reputation: 7358

paginator count all records

Does CakePHP PaginatorHelper have a function for getting a record count (all records in the table, not only on this page)? Like mysql's COUNT() or PHP's mysql_num_rows().

Or i should use the controller's find() function?

Thanks, a lot.

Upvotes: 0

Views: 1435

Answers (2)

Oldskool
Oldskool

Reputation: 34877

The counter() method can be used for that.

echo $this->Paginator->counter(array('format' => '{:count}'));

Upvotes: 2

cetver
cetver

Reputation: 11829

You can use/overwrite paginageCount: http://book.cakephp.org/1.2/view/249/Custom-Query-Pagination

Upvotes: 0

Related Questions