add possibility to generate filter/order elements, with only search box

for now
This commit is contained in:
2021-10-08 16:50:31 +02:00
parent e286acf9fe
commit 4d71a1c630
15 changed files with 325 additions and 89 deletions

View File

@@ -0,0 +1,34 @@
<?php
namespace Chill\MainBundle\Templating\Listing;
use Twig\Environment;
use Twig\Extension\AbstractExtension;
use Twig\TwigFilter;
class Templating extends AbstractExtension
{
public function getFilters()
{
return [
new TwigFilter('chill_render_filter_order_helper', [$this, 'renderFilterOrderHelper'], [
'needs_environment' => true, 'is_safe' => ['html'],
])
];
}
public function renderFilterOrderHelper(
Environment $environment,
FilterOrderHelper $helper,
?string $template = '@ChillMain/FilterOrder/base.html.twig',
?array $options = []
) {
return $environment->render($template, [
'helper' => $helper,
'form' => $helper->buildForm()->createView(),
'options' => $options
]);
}
}