0
votes

I am having customized pagination in cakephp .

<ul class="pagination centerPaginate">
    <?php
    if($this->Paginator->counter('{:pages}') > 1) {
        //If disabled,then last para
        echo $this->Paginator->prev('&laquo;', array( 'tag' => 'li'), null, array('class' => 'prev disabled prv' ,'tag' => 'li', 'escape' => false));
        echo $this->Paginator->numbers(array('separator' => '', 'tag' => 'li' ,'currentClass' => 'active', 'currentTag' => 'a' , 'escape' => false));
        echo $this->Paginator->next('&raquo;', array( 'tag' => 'li'), null, array('class' => 'next disabled nxt' ,'tag' => 'li', 'escape' => false));
    }
    ?>

</ul>                   

The characters i am going to insert are « and » , I used 'escape'=> false .

On 1st page "Previous" Tab contains proper characters . But Next contains Tag like &laquo Not actual character.

On middle pages Tags contain Tag like &laquo etc

And similarly on lastExample page , "Next" Character is ok but problem in Prev character

1

1 Answers

0
votes

I solved it myself ! :)

I added 'escape' => false as 2nd parameter along with 'tag'=>'li' in prev,next

    echo $this->Paginator->prev('&laquo;', array( 'tag' => 'li', 'escape' => false), null, array('class' => 'prev disabled prv' ,'tag' => 'li', 'escape' => false));
    echo $this->Paginator->numbers(array('separator' => '', 'tag' => 'li' ,'currentClass' => 'active', 'currentTag' => 'a' , 'escape' => false));
    echo $this->Paginator->next('&raquo;', array( 'tag' => 'li', 'escape' => false), null, array('class' => 'next disabled nxt' ,'tag' => 'li', 'escape' => false));

Solution below works flawlessly. In $this->Paginator->prev( as 2nd parameter , we specify : if we are not on 1st page ,what should happen , so i gave argument as 'escape' => false and it worked