Twig-CS-Fixer
Twig-CS-Fixer copied to clipboard
Unknown 'form_theme' Tag Error with Custom Form Theme
Hi, I'm having a problem trying to apply a custom form theme in my Symfony project.
When I use the tag {% form_theme form with 'Form/tailwind_2_override_layout.html.twig' %} to define a custom form theme, I get the following error: File is invalid: Unknown "form_theme" tag.
The form adopts the style defined in 'Form/tailwind_2_override_layout.html.twig' but I get the error.
Expected behavior
The form_theme variable should not block twig cs fixer
Actual behavior
An error is generated indicating File is invalid: Unknown "form_theme" tag.
Hi,
Form_theme is already installed,
https://github.com/VincentLanglet/Twig-CS-Fixer/blob/main/src/Environment/StubbedEnvironment.php#L121-L123
did you have installed symfony/twig-bridge
?
Hi,
Form_theme is already installed, https://github.com/VincentLanglet/Twig-CS-Fixer/blob/main/src/Environment/StubbedEnvironment.php#L121-L123 did you have installed
symfony/twig-bridge
?
For other people, the @VincentLanglet answer solved the problem. We had this problem because we installed twig-cs-fixer in a separate directory, as php-cs-fixer recommends.
Thanks @VincentLanglet for your help. My colleague forgot to reply.