Answer the question
In order to leave comments, you need to log in
How to export data from OctoberCMS with filters?
In the admin panel, I implemented a section for viewing applications, added various filters by parameters, now we need to add the ability to upload this list of applications, taking into account filters in csv.
The example from the documentation https://octobercms.com/docs/backend/import-export does not allow passing applied filters for export.
So, how to upload a list in the admin panel, taking into account the selected filters by the user?
Answer the question
In order to leave comments, you need to log in
Found a solution:
function getCurrentFilters()
{
$filters = [];
foreach (\Session::get('widget', []) as $name => $item) {
if (str_contains($name, 'Filter')) {
$filter = @unserialize(@base64_decode($item));
if ($filter) {
$filters[] = $filter;
}
}
}
return $filters;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question