Skip to content

Commit

Permalink
[#3782] Deprecating the read_only option
Browse files Browse the repository at this point in the history
(committed by weaverryan, original credit to the author on this commit)
  • Loading branch information
snoob authored and weaverryan committed Jun 26, 2015
1 parent 0fe1050 commit c9e8634
Show file tree
Hide file tree
Showing 27 changed files with 30 additions and 27 deletions.
2 changes: 0 additions & 2 deletions reference/forms/twig_reference.rst
Expand Up @@ -340,8 +340,6 @@ object:
+------------------------+-------------------------------------------------------------------------------------+
| ``value`` | The value that will be used when rendering (commonly the ``value`` HTML attribute). |
+------------------------+-------------------------------------------------------------------------------------+
| ``read_only`` | If ``true``, ``readonly="readonly"`` is added to the field. |
+------------------------+-------------------------------------------------------------------------------------+
| ``disabled`` | If ``true``, ``disabled="disabled"`` is added to the field. |
+------------------------+-------------------------------------------------------------------------------------+
| ``required`` | If ``true``, a ``required`` attribute is added to the field to activate HTML5 |
Expand Down
2 changes: 1 addition & 1 deletion reference/forms/types/birthday.rst
Expand Up @@ -41,7 +41,7 @@ option defaults to 120 years ago to the current year.
| | - `invalid_message`_ |
| | - `invalid_message_parameters`_ |
| | - `mapped`_ |
| | - `read_only`_ |
| | - `read_only`_ (deprecated as of 2.8) |
+----------------------+-------------------------------------------------------------------------------+
| Parent type | :doc:`date </reference/forms/types/date>` |
+----------------------+-------------------------------------------------------------------------------+
Expand Down
2 changes: 1 addition & 1 deletion reference/forms/types/checkbox.rst
Expand Up @@ -23,7 +23,7 @@ if the box is unchecked, the value will be set to false.
| | - `label`_ |
| | - `label_attr`_ |
| | - `mapped`_ |
| | - `read_only`_ |
| | - `read_only`_ (deprecated as of 2.8) |
| | - `required`_ |
+-------------+------------------------------------------------------------------------+
| Parent type | :doc:`form </reference/forms/types/form>` |
Expand Down
2 changes: 1 addition & 1 deletion reference/forms/types/choice.rst
Expand Up @@ -32,7 +32,7 @@ option.
| | - `label`_ |
| | - `label_attr`_ |
| | - `mapped`_ |
| | - `read_only`_ |
| | - `read_only`_ (deprecated as of 2.8) |
| | - `required`_ |
+-------------+------------------------------------------------------------------------------+
| Parent type | :doc:`form </reference/forms/types/form>` |
Expand Down
2 changes: 1 addition & 1 deletion reference/forms/types/country.rst
Expand Up @@ -42,7 +42,7 @@ you should just use the ``choice`` type directly.
| | - `label`_ |
| | - `label_attr`_ |
| | - `mapped`_ |
| | - `read_only`_ |
| | - `read_only`_ (deprecated as of 2.8) |
| | - `required`_ |
+-------------+-----------------------------------------------------------------------+
| Parent type | :doc:`choice </reference/forms/types/choice>` |
Expand Down
2 changes: 1 addition & 1 deletion reference/forms/types/currency.rst
Expand Up @@ -35,7 +35,7 @@ you should just use the ``choice`` type directly.
| | - `label`_ |
| | - `label_attr`_ |
| | - `mapped`_ |
| | - `read_only`_ |
| | - `read_only`_ (deprecated as of 2.8) |
| | - `required`_ |
+-------------+------------------------------------------------------------------------+
| Parent type | :doc:`choice </reference/forms/types/choice>` |
Expand Down
2 changes: 1 addition & 1 deletion reference/forms/types/date.rst
Expand Up @@ -40,7 +40,7 @@ day and year) or three select boxes (see the `widget`_ option).
| | - `invalid_message`_ |
| | - `invalid_message_parameters`_ |
| | - `mapped`_ |
| | - `read_only`_ |
| | - `read_only`_ (deprecated as of 2.8) |
+----------------------+-----------------------------------------------------------------------------+
| Parent type | :doc:`form </reference/forms/types/form>` |
+----------------------+-----------------------------------------------------------------------------+
Expand Down
2 changes: 1 addition & 1 deletion reference/forms/types/datetime.rst
Expand Up @@ -40,7 +40,7 @@ the data can be a ``DateTime`` object, a string, a timestamp or an array.
| | - `invalid_message`_ |
| | - `invalid_message_parameters`_ |
| | - `mapped`_ |
| | - `read_only`_ |
| | - `read_only`_ (deprecated as of 2.8) |
+----------------------+-----------------------------------------------------------------------------+
| Parent type | :doc:`form </reference/forms/types/form>` |
+----------------------+-----------------------------------------------------------------------------+
Expand Down
2 changes: 1 addition & 1 deletion reference/forms/types/email.rst
Expand Up @@ -19,7 +19,7 @@ The ``email`` field is a text field that is rendered using the HTML5
| | - `label_attr`_ |
| | - `mapped`_ |
| | - `max_length`_ (deprecated as of 2.5) |
| | - `read_only`_ |
| | - `read_only`_ (deprecated as of 2.8) |
| | - `required`_ |
| | - `trim`_ |
+-------------+---------------------------------------------------------------------+
Expand Down
2 changes: 1 addition & 1 deletion reference/forms/types/entity.rst
Expand Up @@ -39,7 +39,7 @@ objects from the database.
| | - `label`_ |
| | - `label_attr`_ |
| | - `mapped`_ |
| | - `read_only`_ |
| | - `read_only`_ (deprecated as of 2.8) |
| | - `required`_ |
+-------------+------------------------------------------------------------------+
| Parent type | :doc:`choice </reference/forms/types/choice>` |
Expand Down
2 changes: 1 addition & 1 deletion reference/forms/types/file.rst
Expand Up @@ -18,7 +18,7 @@ The ``file`` type represents a file input in your form.
| | - `label`_ |
| | - `label_attr`_ |
| | - `mapped`_ |
| | - `read_only`_ |
| | - `read_only`_ (deprecated as of 2.8) |
| | - `required`_ |
+-------------+---------------------------------------------------------------------+
| Parent type | :doc:`form </reference/forms/types/form>` |
Expand Down
2 changes: 1 addition & 1 deletion reference/forms/types/form.rst
Expand Up @@ -30,7 +30,7 @@ on all types for which ``form`` is the parent type.
| | - `pattern`_ (deprecated as of 2.5) |
| | - `post_max_size_message`_ |
| | - `property_path`_ |
| | - `read_only`_ |
| | - `read_only`_ (deprecated as of 2.8) |
| | - `required`_ |
| | - `trim`_ |
+-----------+--------------------------------------------------------------------+
Expand Down
2 changes: 1 addition & 1 deletion reference/forms/types/integer.rst
Expand Up @@ -30,7 +30,7 @@ integers. By default, all non-integer values (e.g. 6.78) will round down
| | - `label`_ |
| | - `label_attr`_ |
| | - `mapped`_ |
| | - `read_only`_ |
| | - `read_only`_ (deprecated as of 2.8) |
| | - `required`_ |
+-------------+-----------------------------------------------------------------------+
| Parent type | :doc:`form </reference/forms/types/form>` |
Expand Down
2 changes: 1 addition & 1 deletion reference/forms/types/language.rst
Expand Up @@ -43,7 +43,7 @@ you should just use the ``choice`` type directly.
| | - `label`_ |
| | - `label_attr`_ |
| | - `mapped`_ |
| | - `read_only`_ |
| | - `read_only`_ (deprecated as of 2.8) |
| | - `required`_ |
+-------------+------------------------------------------------------------------------+
| Parent type | :doc:`choice </reference/forms/types/choice>` |
Expand Down
2 changes: 1 addition & 1 deletion reference/forms/types/locale.rst
Expand Up @@ -45,7 +45,7 @@ you should just use the ``choice`` type directly.
| | - `label`_ |
| | - `label_attr`_ |
| | - `mapped`_ |
| | - `read_only`_ |
| | - `read_only`_ (deprecated as of 2.8) |
| | - `required`_ |
+-------------+------------------------------------------------------------------------+
| Parent type | :doc:`choice </reference/forms/types/choice>` |
Expand Down
2 changes: 1 addition & 1 deletion reference/forms/types/money.rst
Expand Up @@ -29,7 +29,7 @@ how the input and output of the data is handled.
| | - `label`_ |
| | - `label_attr`_ |
| | - `mapped`_ |
| | - `read_only`_ |
| | - `read_only`_ (deprecated as of 2.8) |
| | - `required`_ |
+-------------+---------------------------------------------------------------------+
| Parent type | :doc:`form </reference/forms/types/form>` |
Expand Down
2 changes: 1 addition & 1 deletion reference/forms/types/number.rst
Expand Up @@ -25,7 +25,7 @@ that you want to use for your number.
| | - `label`_ |
| | - `label_attr`_ |
| | - `mapped`_ |
| | - `read_only`_ |
| | - `read_only`_ (deprecated as of 2.8) |
| | - `required`_ |
+-------------+----------------------------------------------------------------------+
| Parent type | :doc:`form </reference/forms/types/form>` |
Expand Down
5 changes: 5 additions & 0 deletions reference/forms/types/options/read_only.rst.inc
@@ -1,6 +1,11 @@
read_only
~~~~~~~~~

.. caution::

The ``read_only`` option has been deprecated and will be removed in 3.0.
Instead, use the ``attr`` option by setting it to an array with a ``readonly`` key.

**type**: ``boolean`` **default**: ``false``

If this option is true, the field will be rendered with the ``readonly``
Expand Down
2 changes: 1 addition & 1 deletion reference/forms/types/password.rst
Expand Up @@ -19,7 +19,7 @@ The ``password`` field renders an input password text box.
| | - `label_attr`_ |
| | - `mapped`_ |
| | - `max_length`_ (deprecated as of 2.5) |
| | - `read_only`_ |
| | - `read_only`_ (deprecated as of 2.8) |
| | - `required`_ |
| | - `trim`_ |
+-------------+------------------------------------------------------------------------+
Expand Down
2 changes: 1 addition & 1 deletion reference/forms/types/percent.rst
Expand Up @@ -28,7 +28,7 @@ This field adds a percentage sign "``%``" after the input box.
| | - `label`_ |
| | - `label_attr`_ |
| | - `mapped`_ |
| | - `read_only`_ |
| | - `read_only`_ (deprecated as of 2.8) |
| | - `required`_ |
+-------------+-----------------------------------------------------------------------+
| Parent type | :doc:`form </reference/forms/types/form>` |
Expand Down
2 changes: 1 addition & 1 deletion reference/forms/types/radio.rst
Expand Up @@ -30,7 +30,7 @@ If you want to have a boolean field, use :doc:`checkbox </reference/forms/types/
| | - `label`_ |
| | - `label_attr`_ |
| | - `mapped`_ |
| | - `read_only`_ |
| | - `read_only`_ (deprecated as of 2.8) |
| | - `required`_ |
+-------------+---------------------------------------------------------------------+
| Parent type | :doc:`checkbox </reference/forms/types/checkbox>` |
Expand Down
2 changes: 1 addition & 1 deletion reference/forms/types/search.rst
Expand Up @@ -20,7 +20,7 @@ Read about the input search field at `DiveIntoHTML5.info`_
| | - `label_attr`_ |
| | - `mapped`_ |
| | - `max_length`_ (deprecated as of 2.5) |
| | - `read_only`_ |
| | - `read_only`_ (deprecated as of 2.8) |
| | - `required`_ |
| | - `trim`_ |
+-------------+----------------------------------------------------------------------+
Expand Down
2 changes: 1 addition & 1 deletion reference/forms/types/text.rst
Expand Up @@ -18,7 +18,7 @@ The text field represents the most basic input text field.
| | - `label_attr`_ |
| | - `mapped`_ |
| | - `max_length`_ (deprecated as of 2.5) |
| | - `read_only`_ |
| | - `read_only`_ (deprecated as of 2.8) |
| | - `required`_ |
| | - `trim`_ |
+-------------+--------------------------------------------------------------------+
Expand Down
2 changes: 1 addition & 1 deletion reference/forms/types/textarea.rst
Expand Up @@ -19,7 +19,7 @@ Renders a ``textarea`` HTML element.
| | - `label_attr`_ |
| | - `mapped`_ |
| | - `max_length`_ (deprecated as of 2.5) |
| | - `read_only`_ |
| | - `read_only`_ (deprecated as of 2.8) |
| | - `required`_ |
| | - `trim`_ |
+-------------+------------------------------------------------------------------------+
Expand Down
2 changes: 1 addition & 1 deletion reference/forms/types/time.rst
Expand Up @@ -37,7 +37,7 @@ stored as a ``DateTime`` object, a string, a timestamp or an array.
| | - `invalid_message`_ |
| | - `invalid_message_parameters`_ |
| | - `mapped`_ |
| | - `read_only`_ |
| | - `read_only`_ (deprecated as of 2.8) |
+----------------------+-----------------------------------------------------------------------------+
| Parent type | form |
+----------------------+-----------------------------------------------------------------------------+
Expand Down

0 comments on commit c9e8634

Please sign in to comment.