Filters not appearing in advanced search
Hi,
I'm trying to use filters in simple modules using a join in list items. But I have not success so far. After reading some documentation and looking for other post I tried to do my filters function like this:
function filters(){
$filters['IDcourse'] = array(
'label' => 'Course',
'type' => 'select',
'options' => $this->courses_model->options_list(),
'first_option' => 'Show All'
);
return $filters;
}
In my_fuel_modules I set 'advanced_search' => TRUE to the module and at the beginning of the model I have this:
public $required = array('IDcourse');
When I click the button for the advanced search there nothing appears. How can I make this work properly?
I could see that in other versions of fuel we can set the filters in the config file, I also tried that and here the dropdown of courses is displayed correctly but no data is displayed even before I do the search.
FYI, IDcourse is a foreign key for my courses table.
Comments
if (method_exists($this->model, 'filters')) { //$this->filters = array_merge($this->filters, $this->model->filters($this->filters)); }
I just uncomment that line and now it's working