$this->load->model("article_model","art"); //载入分页类 $this->load->library('pagination'); $perPage = 2; //配置项设置 $config['base_url'] = site_url('admin/article/index'); $config['total_rows'] = $this->db->count_all_results('hd_article'); $config['per_page'] = $perPage; $config['uri_segment'] = 4; $config['first_link'] = '第一页'; $config['prev_link'] = '上一页'; $config['next_link'] = '下一页'; $config['last_link'] = '最后一页'; $this->pagination->initialize($config); $data['links'] = $this->pagination->create_links(); $offset = $this->uri->segment(4); //偏移位置
$this->db->limit($perPage,$offset); //进行数据库中的分页数据
The above is the content of the use of CI framework paging class (2). For more related content, please pay attention to the PHP Chinese website (www.php.cn)!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

Dreamweaver CS6
Visual web development tools

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.
