• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to make paging from the basics

Hi guys, I'm sorry to open a new topic, but I'm learning with Codeigniter, I read everywhere guides and help on the internet but did not find anything that really explained from scratch how to structure the pagination.

I've tried a lot of things and also tried here on the forum, doing so many tests, but nothing, just showing me the pagination but not working.

This is my controller about database results:

PHP Code:
class Post extends CI_Controller {
function __construct() {
function index() {
       $data['title'] = 'Site';
       $data['desc'] = 'Enter the description of this page index';
       $data['posts'] = $this->post_model->get_post();

While this is the model, in a few words are exactly the code provided by the codeigniter user guide, about tutorials to create news.

PHP Code:
class Post_model extends CI_Model {
function __construct() 
function get_post($slug FALSE
       if ($slug === FALSE) {
           $query $this->db->get();
           return $query->result_array();
       $query $this->db->get_where('post', array('slug'=>$slug));
       return $query->row_array();

I have read this guide https://www.codeigniter.com/user_guide/l...on#example  but I can not personalize everything and then run it. Do I need to create a specific file controller? I do not know how to move.

Thanks to who will help me,

Messages In This Thread
How to make paging from the basics - by Marcolino92 - 08-10-2017, 01:16 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.