CakePHP-Bootstrap / cakephp3-bootstrap-helpers

CakePHP 3.x Helpers for Bootstrap 3 and 4.
https://holt59.github.io/cakephp3-bootstrap-helpers/
MIT License
130 stars 79 forks source link

Paginator numbers options first and last don't work like expected #144

Closed Aerue closed 6 years ago

Aerue commented 6 years ago

The details of the issue is explained here

https://github.com/cakephp/cakephp/issues/11674

Holt59 commented 6 years ago

Thanks for the feedback, this should be fixed by 2772e086b22ccf109b33eba78c35c9c34b22b7b9 along many other paginator bugs...

This helper is quite hard to extend since the original CakePHP helper has no wrapper templates, so I have to re-implement some methods in a brutal way... Maybe I will try to submit a version of this helper with wrapper templates to the original CakePHP repository.

The actual problem you faced was actually not related to the paginator helper, but to the easyIcon trait — The 1 was inadvertently converted to a '1' by the trait...

I have merged the fix into the master and the v3.1.2 branch. Older branches use a different version of the EasyIconTrait so the fix would not work there.

If you cannot update the plugin right now, this should avoid the problem:

$this->Paginator->easyIcon = false; // disable easy icon
echo $this->Paginator->numbers(['modulus' => 4, 'prev' => '<', 'next' => '>', 'first' => 1, 'last' => 1]);
Aerue commented 6 years ago

Latest commit fix the bug on my side. Thanks