How I can set form theme for bundle? In documentation is an example
twig:
form:
resources:
- 'AcmeTaskBundle:Form:form_div_layout.html.twig'
But this form theming to each form in application. If use
{% form_theme form 'AcmeTaskBundle:Form:fields.html.twig' %}
Uncomfortable, because you need write for each form in application.
For example I have 2 main layout and 2 bundle (backend and frontend) and want form theming for each of this bundles. How I can do this? Any ideas?
I think you can use template inheritance.
Put you form_theme call in one of your base layout and every template that inherits from it will use the good form theme.
UPDATE: This may not be possible because you dan't have any reference to the FormView actaully used.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With