title: How to show pagination with product category codeigniter?
body: <p>Hi all I am a new of codeigniter I have problam with pagination on codeigniter I try to search google and youtube but I can not do it who can help me please 
  this my code model:</p>
  
  <pre><code>&lt;?php
  class Product_model extends CI_Model {
  
  
      function get_product($category="") {
          $this-&gt;db-&gt;select('*');
          $this-&gt;db-&gt;from('product');
  
          if($category) {
              $this-&gt;db-&gt;where('category',$category);
          }
  
          $query = $this-&gt;db-&gt;get();
          return $query-&gt;result();
      }
  
  
      function get_total($category="") {
          $this-&gt;db-&gt;select('count(*) AS num_row');
          $this-&gt;db-&gt;from('product');
  
          if($category) {
              $this-&gt;db-&gt;where('category',$category);
          }
          $this-&gt;db-&gt;limit(1);
          $query = $this-&gt;db-&gt;get();
          return $query-&gt;row()-&gt;num_row;
      }
  
  }
  </code></pre>
  
  <p>and this my controoler code:</p>
  
  <pre><code>public function __construct()
      {
          parent::__construct();
          $this-&gt;load-&gt;model('product_model','product');
      }
  public function menu()
      {
          $data = array();
  
          $data['burger'] = $this-&gt;product-&gt;get_product('burger');
          $total_burger = $this-&gt;product-&gt;get_total('burger');
          $limit_burger = 1;
          $link_burger = 'http://localhost/mbl/site/menu/burger';
          $data['pagination_burger'] = $this-&gt;pagination($total_burger,$limit_burger,$link_burger);
  
          $this-&gt;load-&gt;view('header_view');
          $this-&gt;load-&gt;view('nav_view');
          $this-&gt;load-&gt;view('content_view');
          $this-&gt;load-&gt;view('content_left_view',$data);
          $this-&gt;load-&gt;view('content_right_view');
          $this-&gt;load-&gt;view('footer_view');
  
      }
  
  
  
      private function pagination($total ,$per_page ,$link) {
  
          $config['base_url'] = $link;
          $config['total_rows'] = $total;
          $config['per_page'] = $per_page;
          $config['page_query_string'] = TRUE;
  
          $this-&gt;pagination-&gt;initialize($config);
  
          return $this-&gt;pagination-&gt;create_links();
      }
  </code></pre>
  
  <p>and my view:</p>
  
  <pre><code>&lt;h1&gt;Burger&lt;/h1&gt;
  &lt;ul&gt;
      &lt;?php foreach($burger as $val) { ?&gt;
          &lt;li&gt;&lt;?php echo $val-&gt;title; ?&gt;&lt;/li&gt;
      &lt;?php } ?&gt;
  &lt;/ul&gt;
  
  &lt;?php echo $pagination_burger; ?&gt;
  </code></pre>