Note the upgraded forum! If you are experiencing issues logging in, you may need to reset your password which should send an email. If the email doesn't arrive, be sure to check your spam folder just in case.
How to filter admin model list by GET parameter?
I need help for admin side:
In 'one module' I have link -> fuel_url('another_module', array('id' => $id)), which produces URI -> '/admin/another_module?id=1', and on click at that link site goes to the 'another_module' page.
I need to develop auto filtration for items on 'another_module' page by GET parameters, in my example it is by $_GET['id].
I have extended list_items() method in the another_model.php file, but I can't get parameters from URI in it (((.
I have tried CI method $param_id = $this->input->get('id'), and on die($param_id); I can see it.
But when I add it to the WHERE condition, list_items() doesn't see it.
I do it like this:
public function list_items($limit = NULL, $offset = NULL, $col = 'id', $order = 'asc', $just_count = FALSE)
$param_id = $this->input->get('id')
$this->db->where(array('id' => $param_id)) ;
$data = parent::list_items($limit, $offset, $col, $order, $just_count);
I suppose it happens because of AJAX request to - "http://domain/admin/another_module/items/?search_term=&limit=50&view_type=list&offset=0&order=asc&col=name&fuel_inline=0
Please help me. How can I get GET parameters in the _model files?