Created
February 20, 2013 01:51
-
-
Save gerardorochin/4992034 to your computer and use it in GitHub Desktop.
CodeIgniter Pagination Twitter Bootstrap Style
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Pagination Twitter Bootstrap Style | |
* | |
* @access private | |
* @param records per page | |
* @param current page | |
* @param total records | |
* @return string | |
*/ | |
private function _bootstrap_paginate($rpp='', $page='', $total=0) | |
{ | |
$this->load->library('pagination'); | |
$init['base_url'] = ''; | |
$init['total_rows'] = $total; | |
$init['per_page'] = (empty($rpp)) ? 20 : $rpp; | |
$init['cur_page'] = (empty($page)) ? 0 : $page; | |
$init['cur_tag_open'] = '<li class="active"><a class="active" href="#">'; | |
$init['cur_tag_close'] = '</a></li>'; | |
$init['full_tag_open'] = '<ul>'; | |
$init['full_tag_close'] = '</ul>'; | |
$init['num_tag_open'] = '<li>'; | |
$init['num_tag_close'] = '</li>'; | |
$init['next_link'] = '›'; | |
$init['first_link'] = '«'; | |
$init['first_tag_open'] = '<li>'; | |
$init['first_tag_close']= '</li>'; | |
$init['prev_link'] = '‹'; | |
$init['last_link'] = '»'; | |
$init['last_tag_open'] = '<li>'; | |
$init['last_tag_close'] = '</li>'; | |
$init['next_tag_open'] = '<li>'; | |
$init['next_tag_close'] = '</li>'; | |
$init['prev_tag_open'] = '<li>'; | |
$init['prev_tag_close'] = '</li>'; | |
$this->pagination->initialize($init); | |
return $this->pagination->create_links(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment