I want get form field type and set class fot field type
i try:
{# Form field row #}
{% block form_row %}
{% spaceless %}
block_prefixes
is used to generate block names to display field (cf FormRenderer::searchAndRenderBlock
method). The most specific existing block in template (generally form_div_layout.html.twig
file) will be displayed.
So, the last item of block_prefixes
is the id of your input, to allow you to override block for a specific field.
Previous item will be the item you need.
You can use this one : $form->vars.block_prefixes[$form->vars.block_prefixes|count -2]
in smarty syntax.