true, 'is_safe' => ['html'], ]), ]; } /** * @throws SyntaxError * @throws RuntimeError * @throws LoaderError */ public function renderFilterOrderHelper( Environment $environment, FilterOrderHelper $helper, ?string $template = '@ChillMain/FilterOrder/base.html.twig', ?array $options = [] ): string { $otherParameters = []; foreach ($this->requestStack->getCurrentRequest()->query->getIterator() as $key => $value) { switch ($key) { case FilterOrderHelper::FORM_NAME: break; case PaginatorFactory::DEFAULT_CURRENT_PAGE_KEY: // when filtering, go back to page 1 $otherParameters[PaginatorFactory::DEFAULT_CURRENT_PAGE_KEY] = 1; break; default: $otherParameters[$key] = $value; break; } } return $environment->render($template, [ 'helper' => $helper, 'active' => $this->filterOrderGetActiveFilterHelper->getActiveFilters($helper), 'form' => $helper->buildForm()->createView(), 'options' => $options, 'otherParameters' => $otherParameters, ]); } }