把这个保存在 /applications/config/pagination.php
- <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
- /**
- * Pagination Config
- *
- * Just applying codeigniter's standard pagination config with twitter
- * bootstrap stylings
- *
- * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0
- * @author Mike Funk
- * @link http://codeigniter.com/user_guide/libraries/pagination.html
- * @email mike@mikefunk.com
- *
- * @file pagination.php
- * @version 1.3.1
- * @date 03/12/2012
- *
- * Copyright (c) 2011
- */
- // --------------------------------------------------------------------------
-
- // $config['base_url'] = '';
- $config['per_page'] = 15;
- $config['uri_segment'] = 3;
- $config['num_links'] = 10;
- $config['page_query_string'] = FALSE;
- // $config['use_page_numbers'] = TRUE;
- $config['query_string_segment'] = '';
- $config['use_page_numbers'] = TRUE;
-
- $config['full_tag_open'] = '<div class="pagination pagination-centered"><ul>';
- $config['full_tag_close'] = '</ul></div><!--pagination-->';
-
- $config['first_link'] = '« First';
- $config['first_tag_open'] = '<li class="prev page">';
- $config['first_tag_close'] = '</li>';
-
- $config['last_link'] = 'Last »';
- $config['last_tag_open'] = '<li class="next page">';
- $config['last_tag_close'] = '</li>';
-
- $config['next_link'] = 'Next →';
- $config['next_tag_open'] = '<li class="next page">';
- $config['next_tag_close'] = '</li>';
-
- $config['prev_link'] = '← Previous';
- $config['prev_tag_open'] = '<li class="prev page">';
- $config['prev_tag_close'] = '</li>';
-
- $config['cur_tag_open'] = '<li class="active"><a href="">';
- $config['cur_tag_close'] = '</a></li>';
-
- $config['num_tag_open'] = '<li class="page">';
- $config['num_tag_close'] = '</li>';
-
- // $config['display_pages'] = FALSE;
- //
- $config['anchor_class'] = 'follow_link';
-
- // --------------------------------------------------------------------------
-
- /* End of file pagination.php */
- /* Location: ./bookymark/application/config/pagination.php */ <span></span> //使用 base_url自己看情况定义吧
-
- $config['base_url'] = site_url() . '/' . $this->uri->segment(1) . '/' . ( $this->uri->segment(2)?$this->uri->segment(2):'index') .'/';
- $config['total_rows'] = $total;
- $config['per_page'] = $offset;
- $this->pagination->initialize($config);
-
- $this->load->view('show' , array('pagination' => $this->pagination->create_links() , 'sum' => $total , 'offset' => $offset ));
复制代码
|