How to use Bootstrap Pagination in CakePHP

The code below will use Bootstrap Pagination component in your  CakePHP 2.x pagination.


Just copy the code below and replace it to your current pagination component in cakePHP.

1
2
3
4
5
6
7
    <ul class="pagination pagination-sm">
        <?php
        echo $this->Paginator->prev( "&laquo", array( 'class' => '', 'tag' => 'li','escape'=>false ), null, array( 'class' => 'p-control p-control-lborder', 'tag' => 'li','escape'=>false ) );
        echo $this->Paginator->numbers( array( 'tag' => 'li', 'separator' => '', 'currentClass' => 'disabled' ) );
        echo $this->Paginator->next( '&raquo', array( 'class' => '', 'tag' => 'li','escape'=>false ), null, array( 'class' => 'p-control p-control-rborder', 'tag' => 'li','escape'=>false ) );
        ?>
    </ul>

Note: Make sure you included the Bootstrap Pagination component css in your application.

Labels: ,