[eluser]Samuurai[/eluser]
Hi everyone,
I'm trying to get this pagination working.
Here's my controller with the problem line in between comments below!
Code:
index()
{
// would like to avoid using $_GET, but "$this->input->get()" doesn't return true.
if($_GET)
{
$this->_do_search();
}
$this->load->library('pagination');
$config['query_string_segment'] = 'page';
if($_GET)
{
//construct URI with get variables
if($this->input->get('skills'))
$skill_str = "";
foreach($this->input->get('skills') as $skill)
$skill_str .= "&skills;[]=$skill";
$uri_get = base_url()."admin/personnel?start_date=".$this->input->get('start_date')."&end;_date=".$this->input->get('end_date').$skill_str."&sort;=".$this->input->get('sort')."&direction;=".$this->input->get('direction');
}
else
$uri_get = base_url().'admin/personnel';
$config['base_url'] = $uri_get;
// THIS IS THE PROBLEM LINE
$config['total_rows'] = $this->admin_m->perform_search(@$skills,@$start_date,@$end_date,false,false,false,10,true);
$config['per_page'] = '25';
$this->pagination->initialize($config);
}
function _do_search()
{
//Populate $skills, $start_date etc from $this->input->get('variable')
$data->result = $this->admin_m->perform_search($skills,$start_date,$end_date,$page,$sort,$direction,10))
It needs to be in the _do_search function because that's when all the variables are set, however when I move it there and set
the pagination just doesn't show up.
Am I doing this a really silly way? Feels like i'm almost there.
B