My experience with Symfony frontend development is definitely limited. According to http://symfony.com/blog/new-in-symfony-2-6-bootstrap-form-theme I read that adding bootstrap_3_layout.html.twig as a twig form resource I should be able to essentially add Bootstrap themes to my form.
I presume I need to add some CSS files somewhere, maybe, but I haven't even got that far yet.
My problem is that after setting the reference as per the blog post:
# Twig Configuration
twig:
debug: "%kernel.debug%"
strict_variables: "%kernel.debug%"
form:
resources: ["bootstrap_3_layout.html.twig"]
in my config.yml file, I get the following "error stack" in Symfony:
[3/3] Twig_Error_Loader: Unable to find template "bootstrap_3_layout.html.twig" in kernel.root_dir/Resources/views/base.html.twig at line 10.
[2/3] InvalidArgumentException: Unable to find template "bootstrap_3_layout.html.twig" : "The file "bootstrap_3_layout.html.twig" does not exist (in: /path-to-symfony/app/Resources).
[1/3] InvalidArgumentException: The file "bootstrap_3_layout.html.twig" does not exist (in: /path-to-symfony/app/Resources).
I added twig-bridge via composer, just in case, but that doesn't seem to resolve it.
The only location of a file with that name that I can find is at:
./vendor/symfony/symfony/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_layout.html.twig.
If I put a breakpoint in the vendor/twig/twig/lib/Twig/Loader/Filesystem.php file in the findTemplate method, a normal page goes through the process of iterating over $this->paths['__main__'] which has two entries:
- path-to-symfony/app/Resources/views
- path-to-symfony/vendor/symfony/twig-bridge/Symfony/Bridge/Twig/Resources/views/Form
I'm guessing that I need to somehow put the directory that the file is in into that paths array, but don't know how.
Can anyone point me in the direction of this (no doubt) simple solution?
Many thanks.
Twigwhere you are trying to useBootstraptheme? I am currently working on a project that usesBootstrapand I can tell that, apart from regularBootstrap's CSS file, it does not require any other...