CakePHP Paginator and Twitter Boostrap

in CakePHP/HTML/CSS/PHP/Tutorials & Samples

I recently had to integrate CakePHP with Twitter BootStrap. With the CakePHP documentation being what it is, I ended up spending 2 hours pulling my hair out to understand how to integrate the CakePHP Pagination Helper with Twitter Bootstrap. In the end, I turned to the almighty Google and came up with the following solution:

<ul class="pagination pagination-large pull-right">
						<?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>

In all fairness, the solution is not my own, I simply copied the code from StackOverflow and modified it to work with CakePHP 2.3 and Bootstrap 3.0. Here is a link to the Stack Overflow solution

Mifty Yusuf is a Montreal-based software developer who enjoys playing with new web technologies as well as comic books and illustrations. He beleives that, no matter what the question is, the answer is always Batman!

4 Comments

  1. hi brother i need your help please reply asap for this problem

    Objective – Creating a bare minimum web app in cakephp that does the following –
    1. Allows a user to select some contacts from his gmail list just by a single tap login
    2. Saves those contacts in a hosted database (mysql)

Leave a Reply

Your email address will not be published.

*

Latest from CakePHP

Go to Top