$config = array( 'total_rows' => 100, 'per_page' => 10, 'uri_segment' => 3 ); $this->load->library('pagination'); $this->pagination->initialize($config); echo $this->pagination->create_links();
$config = array( 'base_url' => 'http://example.com/index.php/search/results/', 'total_rows' => 200, 'per_page' => 20 ); $this->load->library('pagination'); $this->pagination->initialize($config); echo $this->pagination->create_links();In this example, we are creating pagination links for a search page with 200 results, with 20 results per page. The "base_url" parameter specifies the base URL for the links, which should include the controller, method, and any additional segments. Package Library: CodeIgniter Pagination Library.