CodeIgniter Getting Started learning note 10-pagination

Source: Internet
Author: User
Tags codeigniter

    • A long long time ago to learn CodeIgniter notes, very casual, but all of their own records, I hope that the people who need help.
    • This article uses word2013 to edit and publish
    • Postbird | There I am, in the world more exciting!
    • Postbird Personal website:http://www.ptbird.cn

      ?

      Page out

Public Function Fenye () {

???????????? Load the paging controller

???????????????? $this->load->library (' pagination ');

???????????????? $this->load->helper (' url ');

???????????? Basic Configuration????

???????????????? $page _size=10;

???????????????? $config [' Base_url ']=site_url (' user/fenye ');//Connection

???????????????? $config [' total_rows ']=100;//total number of data

???????????????? $config [' per_page ']= $page _size;//shows the number of bars per page

???????????????? $config [' First_link ']= "Home";

???????????????? $config [' Last_link ']= "last";

???????????????? $config [' Next_link ']= ' >>>> ';

???????????????? $config [' Prev_link ']= ' <<<< ';

???????????????? $config [' uri_segment ']=3;//default is 3

???????????? Initialize????

???????????????? $this->pagination->initialize ($config);

?

???????????? Paging Query Offset

???????????????? $offset =intval ($this->uri->segment (3));

???????????????? $sql = "SELECT * from Blog_user limit $offset, $page _size";

???????????????? Echo $sql;

???????????? Create a connection

???????????????? $data [' Links ']= $this->pagination->create_links ();

???????????? Introducing View????

???????????????? $this->load->view (' header ');

???????????????? $this->load->view (' User/fenye ', $data);

????????}

CodeIgniter Getting Started learning note 10-pagination

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.