[eluser]Ngulo[/eluser]
hi,i've a problem paginating data from db
here is my Controller
templates.php:
Code:
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Templates extends Controller
{
function Templates()
{
parent::Controller();
if(!$this->session->userdata('admin'))
{redirect('admin/home');}
}
function index()
{
$this->load->library('pagination');
$offset=$this->uri->segment(3);
$limit=3;
$this->db->limit($limit, $offset);
$query = $this->db->get('joomla_templx');
$config['per_page'] = $limit;
$config['base_url'] = site_url() . '/admin/templates/';
$config['total_rows'] = $this->db->count_all('joomla_templx');
$config['first_link'] = 'Primo';
$config['next_link'] = 'avanti';
$config['prev_link'] = 'indietro';
$config['last_link'] = 'Ultimo';
$this->pagination->initialize($config);
$paginator=$this->pagination->create_links();
$data = array( 'query' => $query, 'paginator'=>$paginator);
$this->load->view('admin/templates_view',$data);
}
}
/*end of file templates.php*/
the pagination is working ,and i see perfectly pagination links... but when i click on pagination links the page take me back an error:
Code:
404 Page Not Found
The page you requested was not found.
the links are good beacuse they takes me to the base url i have set for $offset :
Code:
www.asd.com/index.php/admin/templates/offset(1...or...2...or ....3...)
p:s:i'm still not using .htaccess
why? :O