From bf5b0c1b690cb5771b8e6c0c40dafd165ca8d4d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=BDilvinas?= Date: Fri, 3 Jan 2014 12:53:43 +0200 Subject: [PATCH 1/3] Update forms.rst Accessing form values via `vars` property instead of getter. Updated PHP templating examples. --- book/forms.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/book/forms.rst b/book/forms.rst index 4611b944f81..3428cb8037d 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') ?> + 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') ?> + Twig Template Function Reference ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From 162816f67084b386ed823739382dadacb0a3aba9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=BDilvinas?= Date: Fri, 3 Jan 2014 12:53:43 +0200 Subject: [PATCH 2/3] Update forms.rst Accessing form values via `vars` property instead of getter. Updated PHP templating examples. --- book/forms.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/book/forms.rst b/book/forms.rst index 4611b944f81..c69158711ac 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') ?> + 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') ?> + 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()); From d8088ff1147320802f8b350aa30e58f7fc447351 Mon Sep 17 00:00:00 2001 From: Zilvinas Kuusas Date: Fri, 3 Jan 2014 13:36:25 +0200 Subject: [PATCH 3/3] Fixed vars as object property, not array --- book/forms.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/book/forms.rst b/book/forms.rst index c69158711ac..4f5dfc2492e 100644 --- a/book/forms.rst +++ b/book/forms.rst @@ -890,7 +890,7 @@ to get the ``id``: .. code-block:: html+php - + 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 - + vars['full_name'] ?> Twig Template Function Reference ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~