找回密码
 立即注册

QQ登录

只需一步,快速开始

Codeigniter+Bootstrap的分页设置

crx349 于 2015-9-30 13:41 [CodeIgniter] 发表在 [复制链接] [显示全部楼层] [打印] [上一主题] [下一主题]
把这个保存在 /applications/config/pagination.php
  1. <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  2. /**
  3. * Pagination Config
  4. *
  5. * Just applying codeigniter's standard pagination config with twitter
  6. * bootstrap stylings
  7. *
  8. * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0
  9. * @author Mike Funk
  10. * @link http://codeigniter.com/user_guide/libraries/pagination.html
  11. * @email mike@mikefunk.com
  12. *
  13. * @file pagination.php
  14. * @version 1.3.1
  15. * @date 03/12/2012
  16. *
  17. * Copyright (c) 2011
  18. */
  19. // --------------------------------------------------------------------------
  20.   
  21. // $config['base_url'] = '';
  22. $config['per_page'] = 15;
  23. $config['uri_segment'] = 3;
  24. $config['num_links'] = 10;
  25. $config['page_query_string'] = FALSE;
  26. // $config['use_page_numbers'] = TRUE;
  27. $config['query_string_segment'] = '';
  28. $config['use_page_numbers'] = TRUE;

  29. $config['full_tag_open'] = '<div class="pagination pagination-centered"><ul>';
  30. $config['full_tag_close'] = '</ul></div><!--pagination-->';
  31.   
  32. $config['first_link'] = '&#171; First';
  33. $config['first_tag_open'] = '<li class="prev page">';
  34. $config['first_tag_close'] = '</li>';
  35.   
  36. $config['last_link'] = 'Last &#187;';
  37. $config['last_tag_open'] = '<li class="next page">';
  38. $config['last_tag_close'] = '</li>';
  39.   
  40. $config['next_link'] = 'Next →';
  41. $config['next_tag_open'] = '<li class="next page">';
  42. $config['next_tag_close'] = '</li>';
  43.   
  44. $config['prev_link'] = '← Previous';
  45. $config['prev_tag_open'] = '<li class="prev page">';
  46. $config['prev_tag_close'] = '</li>';
  47.   
  48. $config['cur_tag_open'] = '<li class="active"><a href="">';
  49. $config['cur_tag_close'] = '</a></li>';
  50.   
  51. $config['num_tag_open'] = '<li class="page">';
  52. $config['num_tag_close'] = '</li>';
  53.   
  54. // $config['display_pages'] = FALSE;
  55. //
  56. $config['anchor_class'] = 'follow_link';
  57.   
  58. // --------------------------------------------------------------------------
  59.   
  60. /* End of file pagination.php */
  61. /* Location: ./bookymark/application/config/pagination.php */ <span></span> //使用 base_url自己看情况定义吧

  62. $config['base_url'] = site_url() . '/' . $this->uri->segment(1) . '/' . ( $this->uri->segment(2)?$this->uri->segment(2):'index') .'/';
  63.         $config['total_rows'] = $total;
  64.         $config['per_page'] = $offset;
  65.         $this->pagination->initialize($config);

  66.         $this->load->view('show'  , array('pagination' => $this->pagination->create_links() , 'sum' => $total , 'offset' => $offset ));
复制代码




本教程由无限星辰工作室CRX349独家整理和提供,转载请注明地址,谢谢。本文地址:https://xmspace.net/thread-388-1-1.html
无限星辰工作室  好集导航 Discuz全集下载  星辰站长网  集热爱361  一品文学  手机小游戏合集   海外空间网 星辰api  星辰支付二维码管理平台 LOT智能硬件聚合平台 阿里云服务器 腾讯云服务器
服务Discuz!建站|DiscuzQ配置|二开|小程序|APP|搬家|挂马清理|防护|Win/Linux环境搭建|优化|运维|
服务理念:专业 诚信 友好QQ842062626 服务项目 Q群315524225

发表于 2015-9-30 13:41:26 | 显示全部楼层 |阅读模式

回复 | 使用道具 举报

该帖共收到 0 条回复!
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

美图秀

    • 自建远程桌面服务器 rustdesk
    • Discuz!x3.4 账号保镖 自动冻结账号无效解
    • PVE换主板后 网络丢失解决方法
    • Kvm 虚拟机迁移到PVE里面
    • Discuz!x3,4 阿里云DCDN配置获取客户端ip
拖动客服框
Online Service
点击这里给我发消息
点击这里联系我们
微信扫一扫
在线客服
快速回复 返回顶部 返回列表