diff --git a/book/forms.rst b/book/forms.rst index 4611b944f81..4f5dfc2492e 100644 --- a/book/forms.rst +++ b/book/forms.rst @@ -784,7 +784,7 @@ output can be customized on many different levels. .. code-block:: html+php - get('value')->getTask() ?> + vars['value']->getTask() ?> .. index:: single: Forms; Rendering each field by hand @@ -890,7 +890,7 @@ to get the ``id``: .. code-block:: html+php - get('id') ?> + vars['id']?> To get the value used for the form field's name attribute you need to use the ``full_name`` value: @@ -903,7 +903,7 @@ the ``full_name`` value: .. code-block:: html+php - get('full_name') ?> + vars['full_name'] ?> Twig Template Function Reference ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -1085,7 +1085,7 @@ the choice is ultimately up to you. The field data can be accessed in a controller with:: $form->get('dueDate')->getData(); - + In addition, the data of an unmapped field can also be modified directly:: $form->get('dueDate')->setData(new \DateTime());