Search code examples
cakephppaginationleading-zero

CakePHP Pagination leading zeroes


I've had a request to build pagination that looks like this:

01 | 02 | 03 | 04

Whilst I know how to pad single digits with a leading zero in PHP, I'm unsure how to get this working in the CakePHP Paginator.

Any pointers please?


Solution

  • Extend the PaginatorHelper class, alias it and overload PaginatorHelper::numbers().

    Sadly the numbers() method is huge.