Commit 456da28 Stefano Sala
committed
1 parent 974cb18 commit 456da28 Copy full SHA for 456da28
File tree 11 files changed +29
-16
lines changed
11 files changed +29
-16
lines changed Original file line number Diff line number Diff line change @@ -707,8 +707,8 @@ the correct values of a number of field options.
707
707
(i.e. is the field ``nullable ``). This is very useful, as your client-side
708
708
validation will automatically match your validation rules.
709
709
710
- * ``max_length ``: If the field is some sort of text field, then the ``max_length ``
711
- option can be guessed from the validation constraints (if ``Length `` or
710
+ * ``maxlength ``: If the field is some sort of text field, then the ``maxlength ``
711
+ option attribute can be guessed from the validation constraints (if ``Length `` or
712
712
``Range `` is used) or from the Doctrine metadata (via the field's length).
713
713
714
714
.. note ::
@@ -719,7 +719,7 @@ the correct values of a number of field options.
719
719
If you'd like to change one of the guessed values, you can override it by
720
720
passing the option in the options field array::
721
721
722
- ->add('task', null, array('max_length ' => 4 ))
722
+ ->add('task', null, array('attr ' => array('maxlength' => 4) ))
723
723
724
724
.. index ::
725
725
single: Forms; Rendering in a template
Original file line number Diff line number Diff line change @@ -350,9 +350,11 @@ object:
350
350
| ``required `` | If ``true ``, a ``required `` attribute is added to the field to activate HTML5 |
351
351
| | validation. Additionally, a ``required `` class is added to the label. |
352
352
+------------------------+-------------------------------------------------------------------------------------+
353
- | ``max_length `` | Adds a ``maxlength `` HTML attribute to the element. |
353
+ | ``max_length `` | Adds a ``maxlength `` HTML attribute to the element. (deprecated as of 2.5, to be |
354
+ | | removed in 3.0, use ``attr["maxlength"] `` instead) |
354
355
+------------------------+-------------------------------------------------------------------------------------+
355
- | ``pattern `` | Adds a ``pattern `` HTML attribute to the element. |
356
+ | ``pattern `` | Adds a ``pattern `` HTML attribute to the element. (deprecated as of 2.5, to be |
357
+ | | removed in 3.0, use ``attr["pattern"] `` instead) |
356
358
+------------------------+-------------------------------------------------------------------------------------+
357
359
| ``label `` | The string label that will be rendered. |
358
360
+------------------------+-------------------------------------------------------------------------------------+
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ The ``email`` field is a text field that is rendered using the HTML5
10
10
+-------------+---------------------------------------------------------------------+
11
11
| Rendered as | ``input `` ``email `` field (a text box) |
12
12
+-------------+---------------------------------------------------------------------+
13
- | Inherited | - `max_length `_ |
13
+ | Inherited | - `max_length `_ (deprecated as of 2.5) |
14
14
| options | - `empty_data `_ |
15
15
| | - `required `_ |
16
16
| | - `label `_ |
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ on all types for which ``form`` is the parent type.
20
20
| | - `trim `_ |
21
21
| | - `mapped `_ |
22
22
| | - `property_path `_ |
23
- | | - `max_length `_ |
23
+ | | - `max_length `_ (deprecated as of 2.5) |
24
24
| | - `by_reference `_ |
25
25
| | - `error_bubbling `_ |
26
26
| | - `inherit_data `_ |
@@ -29,7 +29,7 @@ on all types for which ``form`` is the parent type.
29
29
| | - `invalid_message_parameters `_ |
30
30
| | - `extra_fields_message `_ |
31
31
| | - `post_max_size_message `_ |
32
- | | - `pattern `_ |
32
+ | | - `pattern `_ (deprecated as of 2.5) |
33
33
+-----------+--------------------------------------------------------------------+
34
34
| Inherited | - `block_name `_ |
35
35
| options | - `disabled `_ |
Original file line number Diff line number Diff line change
1
+ .. caution::
2
+
3
+ The ``max_length`` option has been deprecated and will be removed in 3.0.
4
+ Instead, use the ``attr`` option by setting it to an array with a ``maxlength`` key.
5
+
1
6
max_length
2
7
~~~~~~~~~~
3
8
4
9
**type**: ``integer`` **default**: ``null``
5
10
6
- If this option is not null, an attribute ``maxlength`` is added, which
7
- is used by some browsers to limit the amount of text in a field.
11
+ If this option is not null, an attribute ``maxlength`` is added, which
12
+ is used by some browsers to limit the amount of text in a field.
8
13
9
- This is just a browser validation, so data must still be validated
14
+ This is just a browser validation, so data must still be validated
10
15
server-side.
16
+
Original file line number Diff line number Diff line change
1
+ .. caution::
2
+
3
+ The ``pattern`` option has been deprecated and will be removed in 3.0.
4
+ Instead, use the ``attr`` option by setting it to an array with a ``pattern`` key.
5
+
1
6
pattern
2
7
~~~~~~~
3
8
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ The ``password`` field renders an input password text box.
11
11
+-------------+------------------------------------------------------------------------+
12
12
| Options | - `always_empty `_ |
13
13
+-------------+------------------------------------------------------------------------+
14
- | Inherited | - `max_length `_ |
14
+ | Inherited | - `max_length `_ (deprecated as of 2.5) |
15
15
| options | - `empty_data `_ |
16
16
| | - `required `_ |
17
17
| | - `label `_ |
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ Read about the input search field at `DiveIntoHTML5.info`_
12
12
+-------------+----------------------------------------------------------------------+
13
13
| Rendered as | ``input search `` field |
14
14
+-------------+----------------------------------------------------------------------+
15
- | Inherited | - `max_length `_ |
15
+ | Inherited | - `max_length `_ (deprecated as of 2.5) |
16
16
| options | - `empty_data `_ |
17
17
| | - `required `_ |
18
18
| | - `label `_ |
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ The text field represents the most basic input text field.
9
9
+-------------+--------------------------------------------------------------------+
10
10
| Rendered as | ``input `` ``text `` field |
11
11
+-------------+--------------------------------------------------------------------+
12
- | Inherited | - `max_length `_ |
12
+ | Inherited | - `max_length `_ (deprecated as of 2.5) |
13
13
| options | - `empty_data `_ |
14
14
| | - `required `_ |
15
15
| | - `label `_ |
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ Renders a ``textarea`` HTML element.
9
9
+-------------+------------------------------------------------------------------------+
10
10
| Rendered as | ``textarea `` tag |
11
11
+-------------+------------------------------------------------------------------------+
12
- | Inherited | - `max_length `_ |
12
+ | Inherited | - `max_length `_ (deprecated as of 2.5) |
13
13
| options | - `empty_data `_ |
14
14
| | - `required `_ |
15
15
| | - `label `_ |
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ have a protocol.
13
13
+-------------+-------------------------------------------------------------------+
14
14
| Options | - `default_protocol `_ |
15
15
+-------------+-------------------------------------------------------------------+
16
- | Inherited | - `max_length `_ |
16
+ | Inherited | - `max_length `_ (deprecated as of 2.5) |
17
17
| options | - `empty_data `_ |
18
18
| | - `required `_ |
19
19
| | - `label `_ |
You can’t perform that action at this time.
0 commit comments