I have a little trouble with code igniter, I work since 4h this morning, my brain is in off mode.
I have this code,
public function books($Page = 0)
{
$config['base_url'] = base_url('user/books');
//Recherche des livres
$SubSearch = $this->input->post('SubSearch');
//Nombre occurence par page
$SubPerPage = $this->input->post('SubPerPage');
//Configuration du mode d'affichage de tout les livres
//Gestion du champ de recherche
if(isset($SubSearch))
{
$this->session->set_userdata('BookSearch',$this->input->post('Search'));
}
//Gestion du nombre par page
if(isset($SubPerPage))
{
$this->session->set_userdata('PerPage',$this->input->post('PerPage'));
}
//Gestion nombre affichage per page
if(!empty($this->session->userdata('PerPage')))
{
$config['per_page'] = $this->session->userdata('PerPage');
}else
{
$config['per_page'] = 10;
}
//La Requette
if(!empty($this->session->userdata('BookSearch')))
{
$config['total_row'] = $this->functions->getSearch($this->session->userdata('BookSearch'),"","")->num_rows();
$query = $this->functions->getSearch($this->session->userdata('BookSearch'),$Page,$config['per_page']);
}else
{
$config['total_row'] = $this->db->query('SELECT * FROM books')->num_rows();
$query = 'SELECT * FROM books LIMIT '.$Page.','.$config['per_page'].'';
$query = $this->db->query($query);
}
$data['BooksSearchQuery'] = $query->result();
echo 'perpage : '.$config['per_page'];
echo 'total row : '.$config['total_row'];
$this->pagination->initialize($config);
$this->load->view('user/books',$data);
}
But the create_links gives nothing, while the values
echo 'perpage : '.$config['per_page'];
echo 'total row : '.$config['total_row'];
are good. A solution? thank you by advance