diff --git a/changelog.rst b/changelog.rst index b3dd93e571a..62cb6670efe 100644 --- a/changelog.rst +++ b/changelog.rst @@ -57,12 +57,12 @@ Minor Documentation Changes - `c2eda93 `_ #4034 Update internals.rst (redstar504) - `a5ad0df `_ #4035 Update version in Rework your Patch section (yguedidi) - `eed8d64 `_ #4026 Updating Symfony version from 2.4 to 2.5 (danielsan) +- `12752c1 `_ #4013 Removed wrong reference to cookbook (gquemener) +- `ec832dc `_ #3994 [Console] Fix Console component $app to $this and use of getHelper() method (eko) - `d8b037a `_ #4019 Update twig_reference.rst (redstar504) - `7ea87e6 `_ #4016 Fixed the format of one letter-based list (javiereguiluz) - `579a873 `_ #4015 Fixed bad indenting (the list was treated as a blockquote) (javiereguiluz) -- `12752c1 `_ #4013 Removed wrong reference to cookbook (gquemener) - `4669620 `_ #4004 use GitHub instead of Github (xabbuh) -- `ec832dc `_ #3994 [Console] Fix Console component $app to $this and use of getHelper() method (eko) - `a3fe74f `_ #3993 [Console] Fix Console component getHelperSet()->get() to getHelper() (eko) - `a41af7e `_ #3880 document the mysterious abc part of the header (greg0ire) - `90773b0 `_ #3990 Move the section about collect: false to the cookbook entry (weaverryan) diff --git a/contributing/code/bugs.rst b/contributing/code/bugs.rst index a3651de1496..ddb786f17d9 100644 --- a/contributing/code/bugs.rst +++ b/contributing/code/bugs.rst @@ -25,6 +25,10 @@ If your problem definitely looks like a bug, report it using the official bug * Describe the steps needed to reproduce the bug with short code examples (providing a unit test that illustrates the bug is best); +* If the bug you experienced affects more than one layer, providing a simple + failing unit test may not be sufficient. In this case, please fork the + `Symfony Standard Edition`_ and reproduce your issue on a new branch; + * Give as much detail as possible about your environment (OS, PHP version, Symfony version, enabled extensions, ...); @@ -35,3 +39,4 @@ If your problem definitely looks like a bug, report it using the official bug .. _forum: http://forum.symfony-project.org/ .. _IRC channel: irc://irc.freenode.net/symfony .. _tracker: https://github.com/symfony/symfony/issues +.. _Symfony Standard Edition: https://github.com/symfony/symfony-standard/ diff --git a/contributing/community/releases.rst b/contributing/community/releases.rst index d7895443eea..6c953c83f85 100644 --- a/contributing/community/releases.rst +++ b/contributing/community/releases.rst @@ -86,29 +86,31 @@ Below is the schedule for the first few versions that use this release model: This results in very predictable dates and maintenance periods: -+---------+---------+---------------------+-------------+ -| Version | Release | End of Maintenance | End of Life | -+=========+=========+=====================+=============+ -| 2.0 | 07/2011 | 03/2013 (20 months) | 09/2013 | -+---------+---------+---------------------+-------------+ -| 2.1 | 09/2012 | 05/2013 (9 months) | 11/2013 | -+---------+---------+---------------------+-------------+ -| 2.2 | 03/2013 | 11/2013 (8 months) | 05/2014 | -+---------+---------+---------------------+-------------+ -| **2.3** | 05/2013 | 05/2016 (36 months) | 05/2017 | -+---------+---------+---------------------+-------------+ -| 2.4 | 11/2013 | 07/2014 (8 months) | 01/2015 | -+---------+---------+---------------------+-------------+ -| 2.5 | 05/2014 | 01/2015 (8 months) | 07/2015 | -+---------+---------+---------------------+-------------+ -| 2.6 | 11/2014 | 07/2015 (8 months) | 01/2016 | -+---------+---------+---------------------+-------------+ -| **2.7** | 05/2015 | 05/2018 (36 months) | 05/2019 | -+---------+---------+---------------------+-------------+ -| 2.8 | 11/2015 | 07/2016 (8 months) | 01/2017 | -+---------+---------+---------------------+-------------+ -| ... | ... | ... | ... | -+---------+---------+---------------------+-------------+ ++---------+---------+--------------------------+-------------+ +| Version | Release | End of Maintenance | End of Life | ++=========+=========+==========================+=============+ +| 2.0 | 07/2011 | 03/2013 (20 months) | 09/2013 | ++---------+---------+--------------------------+-------------+ +| 2.1 | 09/2012 | 05/2013 (9 months) | 11/2013 | ++---------+---------+--------------------------+-------------+ +| 2.2 | 03/2013 | 11/2013 (8 months) | 05/2014 | ++---------+---------+--------------------------+-------------+ +| **2.3** | 05/2013 | 05/2016 (36 months) | 05/2017 | ++---------+---------+--------------------------+-------------+ +| 2.4 | 11/2013 | 09/2014 (10 months [1]_) | 01/2015 | ++---------+---------+--------------------------+-------------+ +| 2.5 | 05/2014 | 01/2015 (8 months) | 07/2015 | ++---------+---------+--------------------------+-------------+ +| 2.6 | 11/2014 | 07/2015 (8 months) | 01/2016 | ++---------+---------+--------------------------+-------------+ +| **2.7** | 05/2015 | 05/2018 (36 months) | 05/2019 | ++---------+---------+--------------------------+-------------+ +| 2.8 | 11/2015 | 07/2016 (8 months) | 01/2017 | ++---------+---------+--------------------------+-------------+ +| ... | ... | ... | ... | ++---------+---------+--------------------------+-------------+ + +.. [1] Symfony 2.4 maintenance has been `extended to September 2014`_. .. tip:: @@ -179,4 +181,5 @@ version is published every two years and there is a year to upgrade. .. _Git repository: https://github.com/symfony/symfony .. _SensioLabs: http://sensiolabs.com/ .. _roadmap notification: http://symfony.com/roadmap +.. _extended to September 2014: http://symfony.com/blog/extended-maintenance-for-symfony-2-4 .. _timeline calculator: http://symfony.com/roadmap diff --git a/cookbook/console/sending_emails.rst b/cookbook/console/sending_emails.rst index 268976f2dfc..09b92aca26d 100644 --- a/cookbook/console/sending_emails.rst +++ b/cookbook/console/sending_emails.rst @@ -85,6 +85,10 @@ from the ``router`` service and override its settings:: Using Memory Spooling --------------------- +.. versionadded: 2.3 + When using Symfony 2.3+ and SwiftmailerBundle 2.3.5+, the memory spool is now + handled automatically in the CLI and the code below is not necessary anymore. + Sending emails in a console command works the same way as described in the :doc:`/cookbook/email/email` cookbook except if memory spooling is used. diff --git a/cookbook/security/api_key_authentication.rst b/cookbook/security/api_key_authentication.rst index 1965847c009..0add181f1c0 100644 --- a/cookbook/security/api_key_authentication.rst +++ b/cookbook/security/api_key_authentication.rst @@ -232,7 +232,7 @@ you can use to create an error ``Response``. class ApiKeyAuthenticator implements SimplePreAuthenticatorInterface, AuthenticationFailureHandlerInterface { - //... + // ... public function onAuthenticationFailure(Request $request, AuthenticationException $exception) { @@ -427,6 +427,51 @@ configuration or set it to ``false``: ), )); +Even though the token is being stored in the session, the credentials - in this +case the API key (i.e. ``$token->getCredentials()``) - are not stored in the session +for security reasons. To take advantage of the session, update ``ApiKeyAuthenticator`` +to see if the stored token has a valid User object that can be used:: + + // src/Acme/HelloBundle/Security/ApiKeyAuthenticator.php + // ... + + class ApiKeyAuthenticator implements SimplePreAuthenticatorInterface + { + // ... + public function authenticateToken(TokenInterface $token, UserProviderInterface $userProvider, $providerKey) + { + $apiKey = $token->getCredentials(); + $username = $this->userProvider->getUsernameForApiKey($apiKey); + + // User is the Entity which represents your user + $user = $token->getUser(); + if ($user instanceof User) { + return new PreAuthenticatedToken( + $user, + $apiKey, + $providerKey, + $user->getRoles() + ); + } + + if (!$username) { + throw new AuthenticationException( + sprintf('API Key "%s" does not exist.', $apiKey) + ); + } + + $user = $this->userProvider->loadUserByUsername($username); + + return new PreAuthenticatedToken( + $user, + $apiKey, + $providerKey, + $user->getRoles() + ); + } + // ... + } + Storing authentication information in the session works like this: #. At the end of each request, Symfony serializes the token object (returned diff --git a/images/release-process.jpg b/images/release-process.jpg index f3244c121bc..28c58b3fdad 100644 Binary files a/images/release-process.jpg and b/images/release-process.jpg differ diff --git a/reference/forms/types/choice.rst b/reference/forms/types/choice.rst index f7e298ec0aa..d55e1ffb771 100644 --- a/reference/forms/types/choice.rst +++ b/reference/forms/types/choice.rst @@ -115,6 +115,16 @@ Overridden Options ------------------ .. include:: /reference/forms/types/options/empty_data.rst.inc + :end-before: DEFAULT_PLACEHOLDER + +The actual default value of this option depends on other field options: + +* If ``multiple`` is ``false`` and ``expanded`` is ``false``, then ``''`` + (empty string); +* Otherwise ``array()`` (empty array). + +.. include:: /reference/forms/types/options/empty_data.rst.inc + :start-after: DEFAULT_PLACEHOLDER compound ~~~~~~~~ diff --git a/reference/forms/types/collection.rst b/reference/forms/types/collection.rst index 959678c59d3..e3f278eea7c 100644 --- a/reference/forms/types/collection.rst +++ b/reference/forms/types/collection.rst @@ -374,6 +374,12 @@ error_bubbling .. include:: /reference/forms/types/options/by_reference.rst.inc .. include:: /reference/forms/types/options/empty_data.rst.inc + :end-before: DEFAULT_PLACEHOLDER + +The default value is ``array()`` (empty array). + +.. include:: /reference/forms/types/options/empty_data.rst.inc + :start-after: DEFAULT_PLACEHOLDER .. include:: /reference/forms/types/options/required.rst.inc diff --git a/reference/forms/types/country.rst b/reference/forms/types/country.rst index 700e4adb6c6..f077b1fc34a 100644 --- a/reference/forms/types/country.rst +++ b/reference/forms/types/country.rst @@ -76,6 +76,16 @@ These options inherit from the :doc:`choice ` typ These options inherit from the :doc:`form ` type: .. include:: /reference/forms/types/options/empty_data.rst.inc + :end-before: DEFAULT_PLACEHOLDER + +The actual default value of this option depends on other field options: + +* If ``multiple`` is ``false`` and ``expanded`` is ``false``, then ``''`` + (empty string); +* Otherwise ``array()`` (empty array). + +.. include:: /reference/forms/types/options/empty_data.rst.inc + :start-after: DEFAULT_PLACEHOLDER .. include:: /reference/forms/types/options/required.rst.inc diff --git a/reference/forms/types/currency.rst b/reference/forms/types/currency.rst index ba7597bf564..053ffa09101 100644 --- a/reference/forms/types/currency.rst +++ b/reference/forms/types/currency.rst @@ -66,6 +66,16 @@ These options inherit from the :doc:`choice` type These options inherit from the :doc:`form` type: .. include:: /reference/forms/types/options/empty_data.rst.inc + :end-before: DEFAULT_PLACEHOLDER + +The actual default value of this option depends on other field options: + +* If ``multiple`` is ``false`` and ``expanded`` is ``false``, then ``''`` + (empty string); +* Otherwise ``array()`` (empty array). + +.. include:: /reference/forms/types/options/empty_data.rst.inc + :start-after: DEFAULT_PLACEHOLDER .. include:: /reference/forms/types/options/required.rst.inc diff --git a/reference/forms/types/email.rst b/reference/forms/types/email.rst index a3119afd00f..579695b96a0 100644 --- a/reference/forms/types/email.rst +++ b/reference/forms/types/email.rst @@ -36,6 +36,12 @@ These options inherit from the :doc:`form ` type: .. include:: /reference/forms/types/options/max_length.rst.inc .. include:: /reference/forms/types/options/empty_data.rst.inc + :end-before: DEFAULT_PLACEHOLDER + +The default value is ``''`` (the empty string). + +.. include:: /reference/forms/types/options/empty_data.rst.inc + :start-after: DEFAULT_PLACEHOLDER .. include:: /reference/forms/types/options/required.rst.inc diff --git a/reference/forms/types/entity.rst b/reference/forms/types/entity.rst index e68cf6718d6..b11e5971492 100644 --- a/reference/forms/types/entity.rst +++ b/reference/forms/types/entity.rst @@ -212,6 +212,16 @@ These options inherit from the :doc:`choice ` typ These options inherit from the :doc:`form ` type: .. include:: /reference/forms/types/options/empty_data.rst.inc + :end-before: DEFAULT_PLACEHOLDER + +The actual default value of this option depends on other field options: + +* If ``multiple`` is ``false`` and ``expanded`` is ``false``, then ``''`` + (empty string); +* Otherwise ``array()`` (empty array). + +.. include:: /reference/forms/types/options/empty_data.rst.inc + :start-after: DEFAULT_PLACEHOLDER .. include:: /reference/forms/types/options/required.rst.inc diff --git a/reference/forms/types/file.rst b/reference/forms/types/file.rst index 18f0683be0a..a015ffa7fec 100644 --- a/reference/forms/types/file.rst +++ b/reference/forms/types/file.rst @@ -99,6 +99,12 @@ Inherited Options These options inherit from the :doc:`form ` type: .. include:: /reference/forms/types/options/empty_data.rst.inc + :end-before: DEFAULT_PLACEHOLDER + +The default value is ``null``. + +.. include:: /reference/forms/types/options/empty_data.rst.inc + :start-after: DEFAULT_PLACEHOLDER .. include:: /reference/forms/types/options/required.rst.inc diff --git a/reference/forms/types/form.rst b/reference/forms/types/form.rst index a1370c36e0d..3ea7a70cb60 100644 --- a/reference/forms/types/form.rst +++ b/reference/forms/types/form.rst @@ -53,6 +53,18 @@ Field Options .. include:: /reference/forms/types/options/data_class.rst.inc .. include:: /reference/forms/types/options/empty_data.rst.inc + :end-before: DEFAULT_PLACEHOLDER + +The actual default value of this option depends on other field options: + +* If ``data_class`` is set and ``required`` is ``true``, then ``new $data_class()``; +* If ``data_class`` is set and ``required`` is ``false``, then ``null``; +* If ``data_class`` is not set and ``compound`` is ``true``, then ``array()`` + (empty array); +* If ``data_class`` is not set and ``compound`` is ``false``, then ``''`` (empty string). + +.. include:: /reference/forms/types/options/empty_data.rst.inc + :start-after: DEFAULT_PLACEHOLDER .. include:: /reference/forms/types/options/compound.rst.inc diff --git a/reference/forms/types/integer.rst b/reference/forms/types/integer.rst index 4eda2ff3136..045b3af56f9 100644 --- a/reference/forms/types/integer.rst +++ b/reference/forms/types/integer.rst @@ -79,6 +79,12 @@ Inherited Options These options inherit from the :doc:`form ` type: .. include:: /reference/forms/types/options/empty_data.rst.inc + :end-before: DEFAULT_PLACEHOLDER + +The default value is ``''`` (the empty string). + +.. include:: /reference/forms/types/options/empty_data.rst.inc + :start-after: DEFAULT_PLACEHOLDER .. include:: /reference/forms/types/options/required.rst.inc diff --git a/reference/forms/types/language.rst b/reference/forms/types/language.rst index 1b8e78b2db4..fc24b91e36e 100644 --- a/reference/forms/types/language.rst +++ b/reference/forms/types/language.rst @@ -77,6 +77,16 @@ These options inherit from the :doc:`choice ` typ These options inherit from the :doc:`form ` type: .. include:: /reference/forms/types/options/empty_data.rst.inc + :end-before: DEFAULT_PLACEHOLDER + +The actual default value of this option depends on other field options: + +* If ``multiple`` is ``false`` and ``expanded`` is ``false``, then ``''`` + (empty string); +* Otherwise ``array()`` (empty array). + +.. include:: /reference/forms/types/options/empty_data.rst.inc + :start-after: DEFAULT_PLACEHOLDER .. include:: /reference/forms/types/options/required.rst.inc diff --git a/reference/forms/types/locale.rst b/reference/forms/types/locale.rst index 56b588662aa..4a33d06f600 100644 --- a/reference/forms/types/locale.rst +++ b/reference/forms/types/locale.rst @@ -79,6 +79,16 @@ These options inherit from the :doc:`choice ` typ These options inherit from the :doc:`form ` type: .. include:: /reference/forms/types/options/empty_data.rst.inc + :end-before: DEFAULT_PLACEHOLDER + +The actual default value of this option depends on other field options: + +* If ``multiple`` is ``false`` and ``expanded`` is ``false``, then ``''`` + (empty string); +* Otherwise ``array()`` (empty array). + +.. include:: /reference/forms/types/options/empty_data.rst.inc + :start-after: DEFAULT_PLACEHOLDER .. include:: /reference/forms/types/options/required.rst.inc diff --git a/reference/forms/types/money.rst b/reference/forms/types/money.rst index 0f6f07248bb..60fbc9feeca 100644 --- a/reference/forms/types/money.rst +++ b/reference/forms/types/money.rst @@ -49,7 +49,7 @@ Specifies the currency that the money is being specified in. This determines the currency symbol that should be shown by the text box. Depending on the currency - the currency symbol may be shown before or after the input text field. - + This can be any `3 letter ISO 4217 code`_. You can also set this to false to hide the currency symbol. @@ -89,6 +89,12 @@ Inherited Options These options inherit from the :doc:`form ` type: .. include:: /reference/forms/types/options/empty_data.rst.inc + :end-before: DEFAULT_PLACEHOLDER + +The default value is ``''`` (the empty string). + +.. include:: /reference/forms/types/options/empty_data.rst.inc + :start-after: DEFAULT_PLACEHOLDER .. include:: /reference/forms/types/options/required.rst.inc @@ -116,7 +122,7 @@ Form Variables -------------- ============= ========== =============================================================== -Variable Type Usage +Variable Type Usage ============= ========== =============================================================== money_pattern ``string`` The format to use to display the money, including the currency. ============= ========== =============================================================== diff --git a/reference/forms/types/number.rst b/reference/forms/types/number.rst index 4858a5de097..f44b48be514 100644 --- a/reference/forms/types/number.rst +++ b/reference/forms/types/number.rst @@ -45,9 +45,16 @@ rounding_mode If a submitted number needs to be rounded (based on the ``precision`` option), you have several configurable options for that rounding. Each +<<<<<<< HEAD option is a constant on the :class:`Symfony\\Component\\Form\\Extension\\Core\\DataTransformer\\NumberToLocalizedStringTransformer`: * ``NumberToLocalizedStringTransformer::ROUND_DOWN`` Round towards zero. +======= +option is a constant on the :class:`Symfony\\Component\\Form\\Extension\\Core\\DataTransformer\\IntegerToLocalizedStringTransformer`: + +* ``IntegerToLocalizedStringTransformer::ROUND_DOWN`` Rounding mode to + round towards zero. +>>>>>>> 2.3 * ``NumberToLocalizedStringTransformer::ROUND_FLOOR`` Round towards negative infinity. @@ -75,6 +82,12 @@ Inherited Options These options inherit from the :doc:`form ` type: .. include:: /reference/forms/types/options/empty_data.rst.inc + :end-before: DEFAULT_PLACEHOLDER + +The default value is ``''`` (the empty string). + +.. include:: /reference/forms/types/options/empty_data.rst.inc + :start-after: DEFAULT_PLACEHOLDER .. include:: /reference/forms/types/options/required.rst.inc diff --git a/reference/forms/types/options/checkbox_empty_data.rst.inc b/reference/forms/types/options/checkbox_empty_data.rst.inc index d7a09ba3b7b..9e3c2e79427 100644 --- a/reference/forms/types/options/checkbox_empty_data.rst.inc +++ b/reference/forms/types/options/checkbox_empty_data.rst.inc @@ -4,6 +4,5 @@ empty_data **type**: ``string`` **default**: ``mixed`` This option determines what value the field will return when the ``empty_value`` -choice is selected. -In checkbox, the value of ``empty_data`` is overriden by the value returned by -the data transformer (see :doc:`/cookbook/form/data_transformers`). +choice is selected. In the checkbox and the radio type, the value of ``empty_data`` +is overriden by the value returned by the data transformer (see :doc:`/cookbook/form/data_transformers`). diff --git a/reference/forms/types/options/empty_data.rst.inc b/reference/forms/types/options/empty_data.rst.inc index d778c65a79c..34ca9cb878c 100644 --- a/reference/forms/types/options/empty_data.rst.inc +++ b/reference/forms/types/options/empty_data.rst.inc @@ -1,19 +1,15 @@ empty_data ~~~~~~~~~~ -**type**: ``mixed`` **default**: depends on other field options, see below +**type**: ``mixed`` -This option determines what value the field will return when the submitted -value is empty. This may happen when the ``empty_value`` choice in a -``choice`` field is selected or when an ``input`` field of some type is not -required and left empty by the user. +.. This file should only be included with start-after or end-before that's set to + this placeholder value. Its purpose is to let us include only part of this file. -The true default value of this option depends on other field options: +DEFAULT_PLACEHOLDER -* If ``data_class`` is set and ``required`` is ``true``, then ``new $data_class()``; -* If ``data_class`` is set and ``required`` is ``false``, then ``null``; -* If ``data_class`` is not set and ``compound`` is ``true``, then ``array()``; -* If ``data_class`` is not set and ``compound`` is ``false``, then ``''`` (empty string). +This option determines what value the field will return when the submitted +value is empty. But you can customize this to your needs. For example, if you want the ``gender`` choice field to be explicitly set to ``null`` when no value is diff --git a/reference/forms/types/password.rst b/reference/forms/types/password.rst index fa9df3f3b12..3846a097780 100644 --- a/reference/forms/types/password.rst +++ b/reference/forms/types/password.rst @@ -53,6 +53,12 @@ These options inherit from the :doc:`form ` type: .. include:: /reference/forms/types/options/max_length.rst.inc .. include:: /reference/forms/types/options/empty_data.rst.inc + :end-before: DEFAULT_PLACEHOLDER + +The default value is ``''`` (the empty string). + +.. include:: /reference/forms/types/options/empty_data.rst.inc + :start-after: DEFAULT_PLACEHOLDER .. include:: /reference/forms/types/options/required.rst.inc diff --git a/reference/forms/types/percent.rst b/reference/forms/types/percent.rst index c1c2b673ac0..bc0c9bda317 100644 --- a/reference/forms/types/percent.rst +++ b/reference/forms/types/percent.rst @@ -73,6 +73,12 @@ Inherited Options These options inherit from the :doc:`form ` type: .. include:: /reference/forms/types/options/empty_data.rst.inc + :end-before: DEFAULT_PLACEHOLDER + +The default value is ``''`` (the empty string). + +.. include:: /reference/forms/types/options/empty_data.rst.inc + :start-after: DEFAULT_PLACEHOLDER .. include:: /reference/forms/types/options/required.rst.inc diff --git a/reference/forms/types/radio.rst b/reference/forms/types/radio.rst index 946899170cb..5bc292b7d05 100644 --- a/reference/forms/types/radio.rst +++ b/reference/forms/types/radio.rst @@ -44,7 +44,7 @@ These options inherit from the :doc:`form ` type: .. include:: /reference/forms/types/options/data.rst.inc -.. include:: /reference/forms/types/options/empty_data.rst.inc +.. include:: /reference/forms/types/options/checkbox_empty_data.rst.inc .. include:: /reference/forms/types/options/required.rst.inc diff --git a/reference/forms/types/search.rst b/reference/forms/types/search.rst index cc1ceeccb8d..76a8cbcb4b5 100644 --- a/reference/forms/types/search.rst +++ b/reference/forms/types/search.rst @@ -37,6 +37,12 @@ These options inherit from the :doc:`form ` type: .. include:: /reference/forms/types/options/max_length.rst.inc .. include:: /reference/forms/types/options/empty_data.rst.inc + :end-before: DEFAULT_PLACEHOLDER + +The default value is ``''`` (the empty string). + +.. include:: /reference/forms/types/options/empty_data.rst.inc + :start-after: DEFAULT_PLACEHOLDER .. include:: /reference/forms/types/options/required.rst.inc diff --git a/reference/forms/types/text.rst b/reference/forms/types/text.rst index c61de693ab9..24f8492c471 100644 --- a/reference/forms/types/text.rst +++ b/reference/forms/types/text.rst @@ -36,6 +36,12 @@ These options inherit from the :doc:`form ` type: .. include:: /reference/forms/types/options/max_length.rst.inc .. include:: /reference/forms/types/options/empty_data.rst.inc + :end-before: DEFAULT_PLACEHOLDER + +The default value is ``''`` (the empty string). + +.. include:: /reference/forms/types/options/empty_data.rst.inc + :start-after: DEFAULT_PLACEHOLDER .. include:: /reference/forms/types/options/required.rst.inc diff --git a/reference/forms/types/textarea.rst b/reference/forms/types/textarea.rst index ba0f1e4dd19..9be3e1b5150 100644 --- a/reference/forms/types/textarea.rst +++ b/reference/forms/types/textarea.rst @@ -35,6 +35,12 @@ These options inherit from the :doc:`form ` type: .. include:: /reference/forms/types/options/max_length.rst.inc .. include:: /reference/forms/types/options/empty_data.rst.inc + :end-before: DEFAULT_PLACEHOLDER + +The default value is ``''`` (the empty string). + +.. include:: /reference/forms/types/options/empty_data.rst.inc + :start-after: DEFAULT_PLACEHOLDER .. include:: /reference/forms/types/options/required.rst.inc diff --git a/reference/forms/types/timezone.rst b/reference/forms/types/timezone.rst index 89ca811e3fb..3902184d0b6 100644 --- a/reference/forms/types/timezone.rst +++ b/reference/forms/types/timezone.rst @@ -68,6 +68,16 @@ These options inherit from the :doc:`choice ` typ These options inherit from the :doc:`form ` type: .. include:: /reference/forms/types/options/empty_data.rst.inc + :end-before: DEFAULT_PLACEHOLDER + +The actual default value of this option depends on other field options: + +* If ``multiple`` is ``false`` and ``expanded`` is ``false``, then ``''`` + (empty string); +* Otherwise ``array()`` (empty array). + +.. include:: /reference/forms/types/options/empty_data.rst.inc + :start-after: DEFAULT_PLACEHOLDER .. include:: /reference/forms/types/options/required.rst.inc diff --git a/reference/forms/types/url.rst b/reference/forms/types/url.rst index ecd29752cb0..515e2282615 100644 --- a/reference/forms/types/url.rst +++ b/reference/forms/types/url.rst @@ -51,6 +51,12 @@ These options inherit from the :doc:`form ` type: .. include:: /reference/forms/types/options/max_length.rst.inc .. include:: /reference/forms/types/options/empty_data.rst.inc + :end-before: DEFAULT_PLACEHOLDER + +The default value is ``''`` (the empty string). + +.. include:: /reference/forms/types/options/empty_data.rst.inc + :start-after: DEFAULT_PLACEHOLDER .. include:: /reference/forms/types/options/required.rst.inc