Does anyone know how to add custom filters for the Joomla module?
In my helper.php I have this code. but doesn't work
public function __construct($config = array())
{
if(empty($config['filter_fields'])) {
$config['filter_fields'] = array(
'value', 'value'
);
}
parent::__construct($config);
}
public function populateState($ordering = null, $direction = null)
{
$search = $this->getUserStateFromRequest($this->context.'.filter.search', 'filter_search');
$this->setState('filter.search', $search);
parent::populateState('id', 'desc');
}
I have a folder forms and inside it has filter.xml
in the tmpl folder. the in the default.php this is my code
<?php
// Filter Search tools bar
echo JLayoutHelper::render('joomla.searchtools.default', array('view' => $this));
?>