controller page页:

<?php
class Blog extends CI_Controller{
public function __construct(){
parent::__construct();
$this->load->library("table");
$this->load->library("pagination");
}
public function index(){
$config['base_url']='http://127.0.0.1/CI/index.php/blog/index';
$config['total_rows']=$this->db->get("CI_tb")->num_rows();
$config['per_page']=5;
$config['num_links']=15;
$this->pagination->initialize($config);
// $this->load->model("blogs");
$data['results']=$this->db->get("CI_tb",$config['per_page'],$this->uri->segment(3));
$this->load->view("blogs",$data);
} }
?>

view page页:

<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<h1>This is test file!</h1>
<?php echo $this->table->generate($results); ?>
<?php echo $this->pagination->create_links(); ?>
</body>
</html>

codeigniter 分页类练习的更多相关文章

  1. codeigniter分页类传多个参数(转)

    http://example.com/index.php/控制器/方法名/页面的偏移值 页面的偏移值必须是方法名后第一个参数,否者分页类不能判断当前是哪一页,而用ci的分页类进行页面跳转时他是把偏移值 ...

  2. ***CI分页:为CodeIgniter写的分页类

    ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 ...

  3. Ci 自己的分页类【原创】

    这里是自己手写的一个CI分页类的实现 <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); /** ...

  4. PHP 框架: CodeIgniter 分页教程

    PHP 框架: CodeIgniter 分页教程 分类: PHP2009-04-23 11:09 3209人阅读 评论(0) 收藏 举报 框架phpbooksdatabaseurl数据库 目录(?)[ ...

  5. php实现的分页类

    php分页类文件: <?php /** file: page.class.php 完美分页类 Page */ class Page { private $total; //数据表中总记录数 pr ...

  6. asp.net的快捷实用分页类

    KeleyiPager分页类,可以于对列表页进行分页浏览,代码是从HoverTreeCMS项目中COPY的,感觉很不错,使用简单方便,但是功能强大. 在线体验效果:http://cms.hovertr ...

  7. php分页类

    1.需求 学会php分页类的使用 2.参考例子 CI的分页类 3.代码部分 <?php class pagination{ public $pagesize=20; public $pagein ...

  8. PHPCMS V9 分页类的修改教程

    首先,打开 phpcms\libs\functions\global.func.php 这个文件,找到文件第622行的分页函数,复制一下,粘贴到默认分页函数的下面,重新命名后保存.(笔者在此命名为:p ...

  9. php 简单分页类

    /**  file: page.class.php   完美分页类 Page  */ class Page {  private $total;          //数据表中总记录数  privat ...

随机推荐

  1. HW--字符串加解密

    package t0817; import java.util.Scanner; public class StringEncrypt { public static void main(String ...

  2. asp.net Hierarchical Data

    Introduction A Hierarchical Data is a data that is organized in a tree-like structure and structure ...

  3. iOS UIView 快速修改 frame,

    在iOS开发布局修改 frame 时需要繁琐的代码实现,今天偶尔看到一播客说到快速修改的 frame 的方法,自己动手写了一遍实现代码. 快速实现主要通过 添加类目的方式,对UIView 控件添加了一 ...

  4. POJ 1661 Help Jimmy -- 动态规划

    题目地址:http://poj.org/problem?id=1661 Description "Help Jimmy" 是在下图所示的场景上完成的游戏. 场景中包括多个长度和高度 ...

  5. php二维数组,按照指定的key,去排序value值

    $arr = array( '11'=>array( 'a'=>1, 'b'=>2, ), '22'=>array( 'a'=>3, 'b'=>4, ), '33' ...

  6. Linux C 程序 空语句-gcc编译命令(SIX)

    C语言语句1.空语句:当一个if或者while判断部分能完成工作,空语句可以用来表示if或者while内的空循环体 if(a == b ); 2.gcc编译器 //程序的编译过程: // 预处理:pr ...

  7. Socket 入门

    int socket(int domain, int type,int protocol) domain :说明我们网络程序所在的主机采用的通讯协族(AF_UNIX和AF_INET等). AF_UNI ...

  8. chrome常用插件

    1. ModHeader 功能:修改请求头部信息 安装地址:https://chrome.google.com/webstore/detail/idgpnmonknjnojddfkpgkljpfnnf ...

  9. Mongodb FAQ fundamentals(基础篇)

    Mongodb FAQ(基础篇),是官方文档的翻译.如有翻译不到之处,还请谅解. 1.Mongdb是什么数据库? mongodb是一个面向文档(document)的数据库,既不支持表连接,也不支持事务 ...

  10. poj 2559 Largest Rectangle in a Histogram (单调栈)

    http://poj.org/problem?id=2559 Largest Rectangle in a Histogram Time Limit: 1000MS   Memory Limit: 6 ...