Skip to content

Commit 50689c7

Browse files
committed
Fix syntax
1 parent 17d0d87 commit 50689c7

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

forms.rst

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -941,19 +941,18 @@ Additionally, if there are any fields on the form that aren't included in
941941
the submitted data, those fields will be explicitly set to ``null``.
942942

943943
Extra fields
944-
~~~~~~~~~~~~~~~
944+
~~~~~~~~~~~~
945945

946-
All form fields are considered properties of the object but you can inject fields
947-
directly into your view without specifying them in the form definition.
948-
They can be retrieved via the ``getExtraData`` :class:`Symfony\\Component\\Form\\FormTypeInterface`.
946+
All form fields are considered properties of the object but you can inject fields directly into your view without specifying them in the form definition.
947+
They can be retrieved via the ``getExtraData`` :class:`Symfony\\Component\\Form\\FormTypeInterface`.
949948

950949
This is a creation user form::
951950

952951
// ...
952+
use App\User;
953953
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
954954
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
955955
use Symfony\Component\Form\FormBuilderInterface;
956-
use App\User;
957956

958957
class UserCreateType extends AbstractType
959958
{
@@ -973,7 +972,9 @@ This is a creation user form::
973972
}
974973
}
975974

976-
The extra fields can be injected like this::
975+
The extra fields can be injected like this:
976+
977+
.. code-block:: twig
977978
978979
{# templates/user/create.html.twig #}
979980
{{ form_start(form) }}
@@ -988,7 +989,7 @@ The extra fields can be injected like this::
988989
989990
Here, the sponsorship code is an extra field injected at view level.
990991

991-
You can get the referraCode via ``getExtraData``::
992+
You can get the referraCode via ``getExtraData``::
992993

993994
$extraData = $form->getExtraData();
994995
$referraCode = $extraData['referralCode'] ?? null;

0 commit comments

Comments
 (0)