File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change 1
1
Bootstrap 5 Form Theme
2
2
======================
3
3
4
+ .. versionadded :: 5.3
5
+
6
+ The Bootstrap 5 Form Theme was introduce in Symfony 5.3.
7
+
4
8
Symfony provides several ways of integrating Bootstrap into your application. The
5
9
most straightforward way is to add the required ``<link> `` and ``<script> ``
6
10
elements in your templates (usually you only include them in the main layout
@@ -55,13 +59,13 @@ configuration:
55
59
.. code-block :: php
56
60
57
61
// config/packages/twig.php
58
- $container->loadFromExtension('twig', [
59
- 'form_themes' => [
60
- 'bootstrap_5_layout.html. twig',
61
- ],
62
+ use Symfony\Config\TwigConfig;
63
+
64
+ return static function(FrameworkConfig $ twig) {
65
+ $twig->formThemes(['bootstrap_5_layout.html.twig']);
62
66
63
67
// ...
64
- ]) ;
68
+ } ;
65
69
66
70
If you prefer to apply the Bootstrap styles on a form to form basis, include the
67
71
``form_theme `` tag in the templates where those forms are used:
You can’t perform that action at this time.
0 commit comments