public function getTokenParsers(): array
{ return [ // {% form_theme form "SomeBundle::widgets.twig" %}
new FormThemeTokenParser(),
];
} public function getFunctions(): array
{ return [ new TwigFunction('form_widget', null,
['node_class' => SearchAndRenderBlockNode::
class, 'is_safe' =>
['html'
]]),
new TwigFunction('form_errors', null,
['node_class' => SearchAndRenderBlockNode::
class, 'is_safe' =>
['html'
]]),
new TwigFunction('form_label', null,
['node_class' => SearchAndRenderBlockNode::
class, 'is_safe' =>
['html'
]]),
new TwigFunction('form_help', null,
['node_class' => SearchAndRenderBlockNode::
class, 'is_safe' =>
['html'
]]),
new TwigFunction('form_row', null,
['node_class' => SearchAndRenderBlockNode::
class, 'is_safe' =>
['html'
]]),
new TwigFunction('form_rest', null,
['node_class' => SearchAndRenderBlockNode::
class, 'is_safe' =>
['html'
]]),
new TwigFunction('form', null,
['node_class' => RenderBlockNode::
class, 'is_safe' =>
['html'
]]),
new TwigFunction('form_start', null,
['node_class' => RenderBlockNode::
class, 'is_safe' =>
['html'
]]),
new TwigFunction('form_end', null,
['node_class' => RenderBlockNode::
class, 'is_safe' =>
['html'
]]),
new TwigFunction('csrf_token',
[FormRenderer::
class, 'renderCsrfToken'
]),
new TwigFunction('form_parent', 'Symfony\Bridge\Twig\Extension\twig_get_form_parent'
),
new TwigFunction('field_name',
$this->
getFieldName(...
)),