I would like to know how to include a form theme designed for Bootstrap 3. This option was introduced in Symfony 2.6, but in Symfony 3.1 it was moved or deleted, becouse this solution does not work as it should: New in Symfony 2.6: Bootstrap form theme.
When I tried to set:
twig:
debug: "%kernel.debug%"
strict_variables: "%kernel.debug%"
form:
resources: ['bootstrap_3_layout.html.twig']
I got this message:
Fatal error: Uncaught exception 'Symfony\Component\Config\Definition\Exception\InvalidConfigurationException' with message 'Unrecognized option "form" under "twig"' in ...
I know about
{% form_theme form 'bootstrap_3_layout.html.twig' %}
and it works very well, but I want to set this theme permanently in a config file.
I think the config key changed.
Try :
# app/config/config.yml
twig:
form_themes:
- 'bootstrap_3_layout.html.twig'
# ...
http://symfony.com/doc/current/cookbook/form/form_customization.html#twig
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