04-10-2011, 09:17 AM
[eluser]domoench[/eluser]
Hi All,
I'm working through the Nettuts Day 7 Tutorial, and the pagination links are not showing up when I load my view.
My code is as follows:
Controller: site.php
View: site_view.php
My Setup:
- config.php: Set my base url- 'http://localhost/ci_day7/index.php'
- database.php: Set my hostname, username, password, and database db variables.
- autoload.php: loaded 'database' library, and 'url' helper
Does anything above stick out as a reason why the <h1> would display in the view, but the $this->pagination->create_links() line does not?
Hi All,
I'm working through the Nettuts Day 7 Tutorial, and the pagination links are not showing up when I load my view.
My code is as follows:
Controller: site.php
Code:
<?php
class Site extends CI_Controller
{
function index()
{
$this->load->library('pagination');
$config['base_url'] = base_url() . 'site/index/';
$config['total_rows'] = $this->db->get('data')->num_rows();
$config['per_page'] = 10;
$config['num_links'] = 20;
$this->pagination->initialize($config);
$data['records'] = $this->db->get('data', $config['per_page'], $this->uri->segment(3));
$this->load->view('site_view', $data);
}
}
View: site_view.php
Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Title</title>
</head>
<body>
<div id="container">
<h1>Super Pagination With CodeIgniter</h1>
<?php echo $this->pagination->create_links(); ?>
</div>
</body>
</html>
My Setup:
- config.php: Set my base url- 'http://localhost/ci_day7/index.php'
- database.php: Set my hostname, username, password, and database db variables.
- autoload.php: loaded 'database' library, and 'url' helper
Does anything above stick out as a reason why the <h1> would display in the view, but the $this->pagination->create_links() line does not?