This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
lucas.sanner54070
In my record list let's say I want to modify the query according to the values picked in the Category filter.
How can I get the current selected values of a given filter from my controller's functions ?
lucas.sanner54070
Thanks. I finally found out the function I need in this post.
function getCurrentFilters() {
$filters = [];
foreach (\Session::get('widget', []) as $name => $item) {
if (str_contains($name, 'Filter')) {
$filter = @unserialize(@base64_decode($item));
if ($filter) {
array_push($filters, $filter);
}
}
}
return $filters;
}
It's a homemade function but it seems to do the job properly.
However, is there any way to get to the same result natively in October ?
lucas.sanner54070
I did read the documentation but the thing is I want to get the current filter values (scopes) from the reorderExtendQuery($query)
function, but unfortunately the $scope
parameter is not available here.
1-8 of 8