Question

I'm using the prev link for the Paginator component like so:

<?php echo $this->Paginator->prev('&lsaquo;', array('escape'=> false), null, array('escape' => false)); ?>

This produces an escaped version of of when the link is active but does not escape the HTML when the link is disabled.

I'm using CakePHP 2.4

Additional details:

  1. My model, controller and view is in the Plugin folder
  2. My model is not using a database i.e. var $useTable = false;. I get my data via a web service.
  3. I've overridden the paginate function in my model so that I can call the paginated web service.
Was it helpful?

Solution

Are you using BoostCake?

I was having the exact same problem. Active links were being escaped, but disabled ones were not.

I disabled the "BoostCake.BoostCakePaginator" plugin, and all is working fine, so I would assume a bug in that plugin. (I have no time to investigate at the moment, but if/when I do, I will report back.)

OTHER TIPS

like gaurav sharma said, there is a bug.

you should replace $this->link($title) in return-value of public function prev(...) and public function next(...) in BoostCakePaginatorHelper.php (ln94 & ln121) by $this->link($title, NULL, array('escape' => false))

like this:

return parent::prev($title, $options, $this->link($title, NULL, array('escape' => false)), array_merge($options, array(
        'escape' => false,
        'class' => $disabled,
    )));
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top