Skip to content

Commit e3fac90

Browse files
committed
Add versionadded block and update PHP configuration example with new ConfigBuilder
1 parent 20a509a commit e3fac90

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

form/bootstrap5.rst

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
Bootstrap 5 Form Theme
22
======================
33

4+
.. versionadded:: 5.3
5+
6+
The Bootstrap 5 Form Theme was introduce in Symfony 5.3.
7+
48
Symfony provides several ways of integrating Bootstrap into your application. The
59
most straightforward way is to add the required ``<link>`` and ``<script>``
610
elements in your templates (usually you only include them in the main layout
@@ -55,13 +59,13 @@ configuration:
5559
.. code-block:: php
5660
5761
// 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']);
6266
6367
// ...
64-
]);
68+
};
6569
6670
If you prefer to apply the Bootstrap styles on a form to form basis, include the
6771
``form_theme`` tag in the templates where those forms are used:

0 commit comments

Comments
 (0)