mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 22:04:23 +00:00
35 lines
839 B
PHP
35 lines
839 B
PHP
<?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
|
|
]);
|
|
}
|
|
|
|
}
|