List Model

It is a method to get the active filters.

  • return array - Associative array in the format: array('filter_published' => 0)
public function getActiveFilters()
{
$activeFilters = array();

if (!empty($this->filter_fields))
{
foreach ($this->filter_fields as $filter)
{
$filterName = 'filter.' . $filter;

if (property_exists($this->state, $filterName) && (!empty($this->state->{$filterName}) || is_numeric($this->state->{$filterName})))
{
$activeFilters[$filter] = $this->state->get($filterName);
}
}
}

return $activeFilters;
}