Welcome Guest, Not a member yet? Register   Sign In
$config['use_page_numbers'] = TRUE is not working perfectly in codeigniter 2.1.0?
#5

[eluser]somenet[/eluser]
Code:
<?php
class Books extends CI_Controller {
  function __construct() {
    parent::__construct();
  }

  function index() {
    // load pagination class
    $this->load->library('pagination');
    $config['base_url'] = base_url().'books/index/';
    $config['total_rows'] = $this->db->count_all('book');
    $config['use_page_numbers'] = TRUE;
    $config['per_page'] = '1';
    $config['full_tag_open'] = '<p>';
    $config['full_tag_close'] = '</p>';

    $this->pagination->initialize($config);
    $data['results'] = $this->db->get('book',$config['per_page'],$this->uri->segment(3));
  
    // load the HTML Table Class
    $this->load->library('table');
    $this->table->set_heading('BookId', 'Bookname', 'Price', 'Author');
  
    // load the view
    $this->load->view('books_view', $data);
  }
}
when i fetch data in view file it does not return all data from the database as well as actual data also.And my view file is like this
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
&lt;html xml:lang="en-us" lang="en-us"&gt;
&lt;head&gt;
&lt;meta http-equiv="content-type" content="text/html; charset=utf-8" /&gt;
&lt;link rel="stylesheet" href='&lt;?php echo base_url(); ?&gt;css/main.css' type="text/css" media="screen, projection" /&gt;
&lt;title&gt;CodeIgniter Pagination Tutorial&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
<h1>Padam Books</h1>
&lt;?php echo $this->table->generate($results); ?&gt;
&lt;?php echo $this->pagination->create_links(); ?&gt;
&lt;/body&gt;
&lt;/html&gt;


Messages In This Thread
$config['use_page_numbers'] = TRUE is not working perfectly in codeigniter 2.1.0? - by El Forum - 05-20-2012, 05:36 PM



Theme © iAndrew 2016 - Forum software by © MyBB