diff --git a/book/forms.rst b/book/forms.rst index 1a16d84454c..d189c4c8174 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()); 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:: 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, ''); 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 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..d34de3cfc3d --- /dev/null +++ b/reference/forms/types/options/button_auto_initialize.rst.inc @@ -0,0 +1,9 @@ +auto_initialize +~~~~~~~~~~~~~~~ + +**type**: ``boolean`` **default**: ``false`` + +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. 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``.