Skip to content

Commit c9e8634

Browse files
snoobweaverryan
authored andcommitted
[#3782] Deprecating the read_only option
(committed by weaverryan, original credit to the author on this commit)
1 parent 0fe1050 commit c9e8634

27 files changed

+30
-27
lines changed

reference/forms/twig_reference.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,8 +340,6 @@ object:
340340
+------------------------+-------------------------------------------------------------------------------------+
341341
| ``value`` | The value that will be used when rendering (commonly the ``value`` HTML attribute). |
342342
+------------------------+-------------------------------------------------------------------------------------+
343-
| ``read_only`` | If ``true``, ``readonly="readonly"`` is added to the field. |
344-
+------------------------+-------------------------------------------------------------------------------------+
345343
| ``disabled`` | If ``true``, ``disabled="disabled"`` is added to the field. |
346344
+------------------------+-------------------------------------------------------------------------------------+
347345
| ``required`` | If ``true``, a ``required`` attribute is added to the field to activate HTML5 |

reference/forms/types/birthday.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ option defaults to 120 years ago to the current year.
4141
| | - `invalid_message`_ |
4242
| | - `invalid_message_parameters`_ |
4343
| | - `mapped`_ |
44-
| | - `read_only`_ |
44+
| | - `read_only`_ (deprecated as of 2.8) |
4545
+----------------------+-------------------------------------------------------------------------------+
4646
| Parent type | :doc:`date </reference/forms/types/date>` |
4747
+----------------------+-------------------------------------------------------------------------------+

reference/forms/types/checkbox.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ if the box is unchecked, the value will be set to false.
2323
| | - `label`_ |
2424
| | - `label_attr`_ |
2525
| | - `mapped`_ |
26-
| | - `read_only`_ |
26+
| | - `read_only`_ (deprecated as of 2.8) |
2727
| | - `required`_ |
2828
+-------------+------------------------------------------------------------------------+
2929
| Parent type | :doc:`form </reference/forms/types/form>` |

reference/forms/types/choice.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ option.
3232
| | - `label`_ |
3333
| | - `label_attr`_ |
3434
| | - `mapped`_ |
35-
| | - `read_only`_ |
35+
| | - `read_only`_ (deprecated as of 2.8) |
3636
| | - `required`_ |
3737
+-------------+------------------------------------------------------------------------------+
3838
| Parent type | :doc:`form </reference/forms/types/form>` |

reference/forms/types/country.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ you should just use the ``choice`` type directly.
4242
| | - `label`_ |
4343
| | - `label_attr`_ |
4444
| | - `mapped`_ |
45-
| | - `read_only`_ |
45+
| | - `read_only`_ (deprecated as of 2.8) |
4646
| | - `required`_ |
4747
+-------------+-----------------------------------------------------------------------+
4848
| Parent type | :doc:`choice </reference/forms/types/choice>` |

reference/forms/types/currency.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ you should just use the ``choice`` type directly.
3535
| | - `label`_ |
3636
| | - `label_attr`_ |
3737
| | - `mapped`_ |
38-
| | - `read_only`_ |
38+
| | - `read_only`_ (deprecated as of 2.8) |
3939
| | - `required`_ |
4040
+-------------+------------------------------------------------------------------------+
4141
| Parent type | :doc:`choice </reference/forms/types/choice>` |

reference/forms/types/date.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ day and year) or three select boxes (see the `widget`_ option).
4040
| | - `invalid_message`_ |
4141
| | - `invalid_message_parameters`_ |
4242
| | - `mapped`_ |
43-
| | - `read_only`_ |
43+
| | - `read_only`_ (deprecated as of 2.8) |
4444
+----------------------+-----------------------------------------------------------------------------+
4545
| Parent type | :doc:`form </reference/forms/types/form>` |
4646
+----------------------+-----------------------------------------------------------------------------+

reference/forms/types/datetime.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ the data can be a ``DateTime`` object, a string, a timestamp or an array.
4040
| | - `invalid_message`_ |
4141
| | - `invalid_message_parameters`_ |
4242
| | - `mapped`_ |
43-
| | - `read_only`_ |
43+
| | - `read_only`_ (deprecated as of 2.8) |
4444
+----------------------+-----------------------------------------------------------------------------+
4545
| Parent type | :doc:`form </reference/forms/types/form>` |
4646
+----------------------+-----------------------------------------------------------------------------+

reference/forms/types/email.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ The ``email`` field is a text field that is rendered using the HTML5
1919
| | - `label_attr`_ |
2020
| | - `mapped`_ |
2121
| | - `max_length`_ (deprecated as of 2.5) |
22-
| | - `read_only`_ |
22+
| | - `read_only`_ (deprecated as of 2.8) |
2323
| | - `required`_ |
2424
| | - `trim`_ |
2525
+-------------+---------------------------------------------------------------------+

reference/forms/types/entity.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ objects from the database.
3939
| | - `label`_ |
4040
| | - `label_attr`_ |
4141
| | - `mapped`_ |
42-
| | - `read_only`_ |
42+
| | - `read_only`_ (deprecated as of 2.8) |
4343
| | - `required`_ |
4444
+-------------+------------------------------------------------------------------+
4545
| Parent type | :doc:`choice </reference/forms/types/choice>` |

reference/forms/types/file.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The ``file`` type represents a file input in your form.
1818
| | - `label`_ |
1919
| | - `label_attr`_ |
2020
| | - `mapped`_ |
21-
| | - `read_only`_ |
21+
| | - `read_only`_ (deprecated as of 2.8) |
2222
| | - `required`_ |
2323
+-------------+---------------------------------------------------------------------+
2424
| Parent type | :doc:`form </reference/forms/types/form>` |

reference/forms/types/form.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ on all types for which ``form`` is the parent type.
3030
| | - `pattern`_ (deprecated as of 2.5) |
3131
| | - `post_max_size_message`_ |
3232
| | - `property_path`_ |
33-
| | - `read_only`_ |
33+
| | - `read_only`_ (deprecated as of 2.8) |
3434
| | - `required`_ |
3535
| | - `trim`_ |
3636
+-----------+--------------------------------------------------------------------+

reference/forms/types/integer.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ integers. By default, all non-integer values (e.g. 6.78) will round down
3030
| | - `label`_ |
3131
| | - `label_attr`_ |
3232
| | - `mapped`_ |
33-
| | - `read_only`_ |
33+
| | - `read_only`_ (deprecated as of 2.8) |
3434
| | - `required`_ |
3535
+-------------+-----------------------------------------------------------------------+
3636
| Parent type | :doc:`form </reference/forms/types/form>` |

reference/forms/types/language.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ you should just use the ``choice`` type directly.
4343
| | - `label`_ |
4444
| | - `label_attr`_ |
4545
| | - `mapped`_ |
46-
| | - `read_only`_ |
46+
| | - `read_only`_ (deprecated as of 2.8) |
4747
| | - `required`_ |
4848
+-------------+------------------------------------------------------------------------+
4949
| Parent type | :doc:`choice </reference/forms/types/choice>` |

reference/forms/types/locale.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ you should just use the ``choice`` type directly.
4545
| | - `label`_ |
4646
| | - `label_attr`_ |
4747
| | - `mapped`_ |
48-
| | - `read_only`_ |
48+
| | - `read_only`_ (deprecated as of 2.8) |
4949
| | - `required`_ |
5050
+-------------+------------------------------------------------------------------------+
5151
| Parent type | :doc:`choice </reference/forms/types/choice>` |

reference/forms/types/money.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ how the input and output of the data is handled.
2929
| | - `label`_ |
3030
| | - `label_attr`_ |
3131
| | - `mapped`_ |
32-
| | - `read_only`_ |
32+
| | - `read_only`_ (deprecated as of 2.8) |
3333
| | - `required`_ |
3434
+-------------+---------------------------------------------------------------------+
3535
| Parent type | :doc:`form </reference/forms/types/form>` |

reference/forms/types/number.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ that you want to use for your number.
2525
| | - `label`_ |
2626
| | - `label_attr`_ |
2727
| | - `mapped`_ |
28-
| | - `read_only`_ |
28+
| | - `read_only`_ (deprecated as of 2.8) |
2929
| | - `required`_ |
3030
+-------------+----------------------------------------------------------------------+
3131
| Parent type | :doc:`form </reference/forms/types/form>` |

reference/forms/types/options/read_only.rst.inc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
read_only
22
~~~~~~~~~
33

4+
.. caution::
5+
6+
The ``read_only`` option has been deprecated and will be removed in 3.0.
7+
Instead, use the ``attr`` option by setting it to an array with a ``readonly`` key.
8+
49
**type**: ``boolean`` **default**: ``false``
510

611
If this option is true, the field will be rendered with the ``readonly``

reference/forms/types/password.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ The ``password`` field renders an input password text box.
1919
| | - `label_attr`_ |
2020
| | - `mapped`_ |
2121
| | - `max_length`_ (deprecated as of 2.5) |
22-
| | - `read_only`_ |
22+
| | - `read_only`_ (deprecated as of 2.8) |
2323
| | - `required`_ |
2424
| | - `trim`_ |
2525
+-------------+------------------------------------------------------------------------+

reference/forms/types/percent.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ This field adds a percentage sign "``%``" after the input box.
2828
| | - `label`_ |
2929
| | - `label_attr`_ |
3030
| | - `mapped`_ |
31-
| | - `read_only`_ |
31+
| | - `read_only`_ (deprecated as of 2.8) |
3232
| | - `required`_ |
3333
+-------------+-----------------------------------------------------------------------+
3434
| Parent type | :doc:`form </reference/forms/types/form>` |

reference/forms/types/radio.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ If you want to have a boolean field, use :doc:`checkbox </reference/forms/types/
3030
| | - `label`_ |
3131
| | - `label_attr`_ |
3232
| | - `mapped`_ |
33-
| | - `read_only`_ |
33+
| | - `read_only`_ (deprecated as of 2.8) |
3434
| | - `required`_ |
3535
+-------------+---------------------------------------------------------------------+
3636
| Parent type | :doc:`checkbox </reference/forms/types/checkbox>` |

reference/forms/types/search.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Read about the input search field at `DiveIntoHTML5.info`_
2020
| | - `label_attr`_ |
2121
| | - `mapped`_ |
2222
| | - `max_length`_ (deprecated as of 2.5) |
23-
| | - `read_only`_ |
23+
| | - `read_only`_ (deprecated as of 2.8) |
2424
| | - `required`_ |
2525
| | - `trim`_ |
2626
+-------------+----------------------------------------------------------------------+

reference/forms/types/text.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The text field represents the most basic input text field.
1818
| | - `label_attr`_ |
1919
| | - `mapped`_ |
2020
| | - `max_length`_ (deprecated as of 2.5) |
21-
| | - `read_only`_ |
21+
| | - `read_only`_ (deprecated as of 2.8) |
2222
| | - `required`_ |
2323
| | - `trim`_ |
2424
+-------------+--------------------------------------------------------------------+

reference/forms/types/textarea.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Renders a ``textarea`` HTML element.
1919
| | - `label_attr`_ |
2020
| | - `mapped`_ |
2121
| | - `max_length`_ (deprecated as of 2.5) |
22-
| | - `read_only`_ |
22+
| | - `read_only`_ (deprecated as of 2.8) |
2323
| | - `required`_ |
2424
| | - `trim`_ |
2525
+-------------+------------------------------------------------------------------------+

reference/forms/types/time.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ stored as a ``DateTime`` object, a string, a timestamp or an array.
3737
| | - `invalid_message`_ |
3838
| | - `invalid_message_parameters`_ |
3939
| | - `mapped`_ |
40-
| | - `read_only`_ |
40+
| | - `read_only`_ (deprecated as of 2.8) |
4141
+----------------------+-----------------------------------------------------------------------------+
4242
| Parent type | form |
4343
+----------------------+-----------------------------------------------------------------------------+

0 commit comments

Comments
 (0)