0
votes

When using the paginator numbers helper in Cakephp 2.4.4, setting 'tag' => false in the options seems to cause all settings defined in the 'class' and 'currentClass' options to be ignored.

Using the following settings:

<?php echo $this->Paginator->numbers(array('separator' => '', 'currentClass' => 'btn btn-primary', 'class' => 'btn btn-default')); ?>

The html output looks something like this:

<span class="btn btn-default">
 <a href="/callhistory/page:3">3</a>
</span>

However, when I set 'tag' => false :

<?php echo $this->Paginator->numbers(array('separator' => '', 'currentClass' => 'btn btn-primary', 'class' => 'btn btn-default', 'tag' => false)); ?>

The html output looks like this:

<a href="/callhistory/page:3">3</a>

I would expect it to look something like this as this is how the prev and next helpers behave:

<a href="/callhistory/page:3" class="btn btn-default">3</a>

Is this expected behavior? I would like my buttons to be formatted as shown in the code above. I'm not sure if I'm doing something wrong or not.

1
This looks like it may be a bug. I have opened an issue on this on Github. github.com/cakephp/cakephp/issues/2833When1ConsumeMem

1 Answers

0
votes

The bug was confirmed, closed and will not be fixed until CakePHP 3 is released. I created my own workaround for the issue, but it does break other functionalities in CakePHP so it is not recommended that you use it.

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