- 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