Create a gist now

Instantly share code, notes, and snippets.

Embed
pagination bootstrap cakephp
<div class="pagination pagination-large">
<ul>
<?php
echo $this->Paginator->prev(__('prev'), array('tag' => 'li'), null, array('tag' => 'li','class' => 'disabled','disabledTag' => 'a'));
echo $this->Paginator->numbers(array('separator' => '','currentTag' => 'a', 'currentClass' => 'active','tag' => 'li','first' => 1));
echo $this->Paginator->next(__('next'), array('tag' => 'li','currentClass' => 'disabled'), null, array('tag' => 'li','class' => 'disabled','disabledTag' => 'a'));
?>
</ul>
</div>
@Triton36

This comment has been minimized.

Show comment
Hide comment
@Triton36

Triton36 Apr 4, 2013

There is a problem with ellipsis in this example.
Ellipsis is displayed after next button.

Triton36 commented Apr 4, 2013

There is a problem with ellipsis in this example.
Ellipsis is displayed after next button.

@girishgowdayt

This comment has been minimized.

Show comment
Hide comment
@girishgowdayt

girishgowdayt Nov 16, 2013

for bootstrap 3 and cakephp 2, remove the div and add only the class 'pagination' to ul.
use three php echo statements inside three list items(li)

for bootstrap 3 and cakephp 2, remove the div and add only the class 'pagination' to ul.
use three php echo statements inside three list items(li)

@hurlatunde

This comment has been minimized.

Show comment
Hide comment
@hurlatunde

hurlatunde May 2, 2014

:)

:)

@ccalabro

This comment has been minimized.

Show comment
Hide comment
@ccalabro

ccalabro Feb 12, 2015

If you take off 'first' => 1 from the second line, the ellipsis won't appear and you won't have the display problem.

If you take off 'first' => 1 from the second line, the ellipsis won't appear and you won't have the display problem.

@jruzafa

This comment has been minimized.

Show comment
Hide comment
@jruzafa

jruzafa Feb 13, 2015

@ccalabro send me a screenshot for amply enlarge this gist 😄

Owner

jruzafa commented Feb 13, 2015

@ccalabro send me a screenshot for amply enlarge this gist 😄

@irwebuniq

This comment has been minimized.

Show comment
Hide comment
@irwebuniq

irwebuniq Apr 26, 2015

        echo $this->Paginator->prev('<i class="fa fa-chevron-left"></i>', array('escape'=>false,'tag' => 'li'), null, array('escape'=>false, 'tag' => 'li','class' => 'disabled','disabledTag' => 'a'));
        echo $this->Paginator->numbers(array('separator' => '','currentTag' => 'a', 'currentClass' => 'active','tag' => 'li','first' => 1));
        echo $this->Paginator->next('<i class="fa fa-chevron-right"></i>', array('escape'=>false, 'tag' => 'li','currentClass' => 'disabled'), null, array('escape'=>false,'tag' => 'li','class' => 'disabled','disabledTag' => 'a'));
        echo $this->Paginator->prev('<i class="fa fa-chevron-left"></i>', array('escape'=>false,'tag' => 'li'), null, array('escape'=>false, 'tag' => 'li','class' => 'disabled','disabledTag' => 'a'));
        echo $this->Paginator->numbers(array('separator' => '','currentTag' => 'a', 'currentClass' => 'active','tag' => 'li','first' => 1));
        echo $this->Paginator->next('<i class="fa fa-chevron-right"></i>', array('escape'=>false, 'tag' => 'li','currentClass' => 'disabled'), null, array('escape'=>false,'tag' => 'li','class' => 'disabled','disabledTag' => 'a'));
@hg8

This comment has been minimized.

Show comment
Hide comment
@hg8

hg8 Apr 29, 2015

@irwebuniq Thanks! Work great.

hg8 commented Apr 29, 2015

@irwebuniq Thanks! Work great.

@temistoclesarea

This comment has been minimized.

Show comment
Hide comment
@temistoclesarea

temistoclesarea Jun 17, 2016

For me only works this way:

<div>
<ul class="pagination pagination-large">
...
</ul>
</div>

I had to put the class in ul
I found unnecessary div
It would be interesting to tell the version of the bootstrap and cakephp used in example
Thanks! Great code.

For me only works this way:

<div>
<ul class="pagination pagination-large">
...
</ul>
</div>

I had to put the class in ul
I found unnecessary div
It would be interesting to tell the version of the bootstrap and cakephp used in example
Thanks! Great code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment