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 01/10] 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 02/10] 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 03/10] 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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From 49a02dc6b68af7cf71c5bde1cb5820429b7b1679 Mon Sep 17 00:00:00 2001 From: Daniel Gomes Date: Sat, 4 Jan 2014 22:39:56 +0000 Subject: [PATCH 04/10] Fixed broken urls --- components/console/introduction.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/components/console/introduction.rst b/components/console/introduction.rst index 4ca2bcfe8c1..0c799f8e84b 100644 --- a/components/console/introduction.rst +++ b/components/console/introduction.rst @@ -199,10 +199,10 @@ level. For example:: } .. versionadded:: 2.4 - The :method:`Symfony\\Component\Console\\Output\\Output::isQuiet`, - :method:`Symfony\\Component\Console\\Output\\Output::isVerbose`, - :method:`Symfony\\Component\Console\\Output\\Output::isVeryVerbose` and - :method:`Symfony\\Component\Console\\Output\\Output::isDebug` + The :method:`Symfony\\Component\\Console\\Output\\Output::isQuiet`, + :method:`Symfony\\Component\\Console\\Output\\Output::isVerbose`, + :method:`Symfony\\Component\\Console\\Output\\Output::isVeryVerbose` and + :method:`Symfony\\Component\\Console\\Output\\Output::isDebug` methods were introduced in version 2.4 There are also more semantic methods you can use to test for each of the @@ -225,7 +225,7 @@ verbosity levels:: } When the quiet level is used, all output is suppressed as the default -:method:`Symfony\Component\Console\Output::write ` +:method:`Symfony\Component\Console\Output::write ` method returns without actually printing. .. tip:: From acea66692c74b7e797a3939e6f1ef190d0039962 Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Sun, 5 Jan 2014 11:16:28 -0600 Subject: [PATCH 05/10] [#3424] Backporting a change to 2.3 --- components/console/introduction.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/console/introduction.rst b/components/console/introduction.rst index bc709a2abc9..961b83d33be 100644 --- a/components/console/introduction.rst +++ b/components/console/introduction.rst @@ -197,7 +197,7 @@ level. For example:: } When the quiet level is used, all output is suppressed as the default -:method:`Symfony\Component\Console\Output::write ` +:method:`Symfony\Component\Console\Output::write ` method returns without actually printing. Using Command Arguments From 00d7a2ce8397b67c410eb9aebb8a0f42a432044a Mon Sep 17 00:00:00 2001 From: Yves ASTIER Date: Thu, 2 Jan 2014 15:09:00 +0100 Subject: [PATCH 06/10] syntax error corrected --- cookbook/console/usage.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookbook/console/usage.rst b/cookbook/console/usage.rst index b64462a9378..2e6deca06e8 100644 --- a/cookbook/console/usage.rst +++ b/cookbook/console/usage.rst @@ -23,7 +23,7 @@ or the equivalent: .. code-block:: bash - $ php app/console cache:clear -e=prod + $ php app/console cache:clear -e prod In addition to changing the environment, you can also choose to disable debug mode. This can be useful where you want to run commands in the ``dev`` environment From d85a165a5cc936a635d0ae6955d31a0054a09425 Mon Sep 17 00:00:00 2001 From: Johan Desmyter Date: Fri, 3 Jan 2014 08:48:01 +0300 Subject: [PATCH 07/10] add default value to mapped option of entity --- reference/forms/types/options/mapped.rst.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/forms/types/options/mapped.rst.inc b/reference/forms/types/options/mapped.rst.inc index 434f97ebd89..044eedc815e 100644 --- a/reference/forms/types/options/mapped.rst.inc +++ b/reference/forms/types/options/mapped.rst.inc @@ -1,7 +1,7 @@ mapped ~~~~~~ -**type**: ``boolean`` +**type**: ``boolean`` **default**: ``true`` If you wish the field to be ignored when reading or writing to the object, you can set the ``mapped`` option to ``false``. From 976f61c6e0285fbe0759990798281a0d39a13e65 Mon Sep 17 00:00:00 2001 From: Johan Desmyter Date: Fri, 3 Jan 2014 22:39:13 +0300 Subject: [PATCH 08/10] document auto_initialize overriden option --- reference/forms/types/button.rst | 4 ++++ .../forms/types/options/button_auto_initialize.rst.inc | 7 +++++++ 2 files changed, 11 insertions(+) create mode 100644 reference/forms/types/options/button_auto_initialize.rst.inc diff --git a/reference/forms/types/button.rst b/reference/forms/types/button.rst index 5c73b5f34e1..44bf65a90b7 100644 --- a/reference/forms/types/button.rst +++ b/reference/forms/types/button.rst @@ -18,6 +18,8 @@ A simple, non-responsive button. | | - `label_attr`_ | | | - `translation_domain`_ | +----------------------+----------------------------------------------------------------------+ +| Overridden Options | - `auto_initialize` | ++----------------------+----------------------------------------------------------------------+ | Parent type | none | +----------------------+----------------------------------------------------------------------+ | Class | :class:`Symfony\\Component\\Form\\Extension\\Core\\Type\\ButtonType` | @@ -35,3 +37,5 @@ Options .. include:: /reference/forms/types/options/label_attr.rst.inc .. include:: /reference/forms/types/options/button_translation_domain.rst.inc + +.. include:: /reference/forms/types/options/button_auto_initialize.rst.inc diff --git a/reference/forms/types/options/button_auto_initialize.rst.inc b/reference/forms/types/options/button_auto_initialize.rst.inc new file mode 100644 index 00000000000..c16ffd843ce --- /dev/null +++ b/reference/forms/types/options/button_auto_initialize.rst.inc @@ -0,0 +1,7 @@ +auto_initialize +~~~~~~~~~~~~~~~ + +**type**: ``boolean`` **default**: ``false`` + +Sets whether the form should be initialized automatically. This option is +not modifiable as buttons do not support automatic initialization. From 3205bbd57b2c3e93aeea6944fd1e947b9ba46ec4 Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Tue, 7 Jan 2014 08:15:24 -0600 Subject: [PATCH 09/10] [#3407] Re-wording things so that people don't pay too much attention to auto_initialize --- .../forms/types/options/button_auto_initialize.rst.inc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/reference/forms/types/options/button_auto_initialize.rst.inc b/reference/forms/types/options/button_auto_initialize.rst.inc index c16ffd843ce..d34de3cfc3d 100644 --- a/reference/forms/types/options/button_auto_initialize.rst.inc +++ b/reference/forms/types/options/button_auto_initialize.rst.inc @@ -3,5 +3,7 @@ auto_initialize **type**: ``boolean`` **default**: ``false`` -Sets whether the form should be initialized automatically. This option is -not modifiable as buttons do not support automatic initialization. +An internal option: sets whether the form should be initialized automatically. +For all fields, this option should only be ``true`` for root forms and since +a button can't be an entire form on its own, this is set to ``false``. You +won't need to change this option and probably won't need to worry about it. From 83440f8e156b5aac5d759442cb4a80ffd9aca0bf Mon Sep 17 00:00:00 2001 From: Gunnar Lium Date: Fri, 3 Jan 2014 09:31:52 +0100 Subject: [PATCH 10/10] Use static Request methods in Trusting Proxies doc As these methods manipulate static properties, it makes sense to use the static methods. This also means that we don't need to create a throwaway Request instance just to set the trusted proxies. --- components/http_foundation/trusting_proxies.rst | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/components/http_foundation/trusting_proxies.rst b/components/http_foundation/trusting_proxies.rst index 1606e496156..591a58b09b7 100644 --- a/components/http_foundation/trusting_proxies.rst +++ b/components/http_foundation/trusting_proxies.rst @@ -22,10 +22,8 @@ your proxy. use Symfony\Component\HttpFoundation\Request; - $request = Request::createFromGlobals(); - // only trust proxy headers coming from this IP addresses - $request->setTrustedProxies(array('192.0.0.1', '10.0.0.0/8')); + Request::setTrustedProxies(array('192.0.0.1', '10.0.0.0/8')); Configuring Header Names ------------------------ @@ -40,10 +38,10 @@ By default, the following proxy headers are trusted: If your reverse proxy uses a different header name for any of these, you can configure that header name via :method:`Symfony\\Component\\HttpFoundation\\Request::setTrustedHeaderName`:: - $request->setTrustedHeaderName(Request::HEADER_CLIENT_IP, 'X-Proxy-For'); - $request->setTrustedHeaderName(Request::HEADER_CLIENT_HOST, 'X-Proxy-Host'); - $request->setTrustedHeaderName(Request::HEADER_CLIENT_PORT, 'X-Proxy-Port'); - $request->setTrustedHeaderName(Request::HEADER_CLIENT_PROTO, 'X-Proxy-Proto'); + Request::setTrustedHeaderName(Request::HEADER_CLIENT_IP, 'X-Proxy-For'); + Request::setTrustedHeaderName(Request::HEADER_CLIENT_HOST, 'X-Proxy-Host'); + Request::setTrustedHeaderName(Request::HEADER_CLIENT_PORT, 'X-Proxy-Port'); + Request::setTrustedHeaderName(Request::HEADER_CLIENT_PROTO, 'X-Proxy-Proto'); Not trusting certain Headers ---------------------------- @@ -53,4 +51,4 @@ listed above are trusted. If you need to trust some of these headers but not others, you can do that as well:: // disables trusting the ``X-Forwarded-Proto`` header, the default header is used - $request->setTrustedHeaderName(Request::HEADER_CLIENT_PROTO, ''); + Request::setTrustedHeaderName(Request::HEADER_CLIENT_PROTO, '');