We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2ab9c84 commit b53b29dCopy full SHA for b53b29d
form/bootstrap4.rst
@@ -122,6 +122,13 @@ Symfony Form ``RadioType`` and ``CheckboxType`` by adding some classes to the la
122
* For a `custom checkbox`_, use ``checkbox-custom``;
123
* For having a `switch instead of a checkbox`_, use ``switch-custom``.
124
125
+Appending an Asterisk to Required Fields
126
+----------------------------------------
127
+
128
+Since form errors are rendered *inside* the ``<label>``, you cannot use CSS ``:after``
129
+to append an asterisk to the label, cause it would be displayed after the error message.
130
+Use
131
132
.. code-block:: twig
133
134
{{ form_row(form.myRadio, {label_attr: {class: 'radio-custom'} }) }}
0 commit comments