Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a1d0353

Browse filesBrowse files
committed
minor #6206 add separate placeholder examples for birthday, datetime and time type (snoek09)
This PR was squashed before being merged into the 2.7 branch (closes #6206). Discussion ---------- add separate placeholder examples for birthday, datetime and time type | Q | A | ------------- | --- | Doc fix? | yes | New docs? | yes | Applies to | 2.7 | Fixed tickets | #6178 Commits ------- 70852c8 add separate placeholder examples for birthday, datetime and time type
2 parents d1e109e + 70852c8 commit a1d0353
Copy full SHA for a1d0353

File tree

Expand file treeCollapse file tree

4 files changed

+85
-9
lines changed
Filter options
Expand file treeCollapse file tree

4 files changed

+85
-9
lines changed

‎reference/forms/types/birthday.rst

Copy file name to clipboardExpand all lines: reference/forms/types/birthday.rst
+25-1Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,31 @@ type:
6767

6868
.. include:: /reference/forms/types/options/days.rst.inc
6969

70-
.. include:: /reference/forms/types/options/placeholder.rst.inc
70+
placeholder
71+
~~~~~~~~~~~
72+
73+
.. versionadded:: 2.6
74+
The ``placeholder`` option was introduced in Symfony 2.6 and replaces
75+
``empty_value``, which is available prior to 2.6.
76+
77+
**type**: ``string`` | ``array``
78+
79+
If your widget option is set to ``choice``, then this field will be represented
80+
as a series of ``select`` boxes. When the placeholder value is a string,
81+
it will be used as the **blank value** of all select boxes::
82+
83+
$builder->add('birthdate', 'birthday', array(
84+
'placeholder' => 'Select a value',
85+
));
86+
87+
Alternatively, you can use an array that configures different placeholder
88+
values for the year, month and day fields::
89+
90+
$builder->add('birthdate', 'birthday', array(
91+
'placeholder' => array(
92+
'year' => 'Year', 'month' => 'Month', 'day' => 'Day',
93+
)
94+
));
7195

7296
.. include:: /reference/forms/types/options/date_format.rst.inc
7397

‎reference/forms/types/date.rst

Copy file name to clipboardExpand all lines: reference/forms/types/date.rst
+9-6Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,20 +88,23 @@ placeholder
8888
The ``placeholder`` option was introduced in Symfony 2.6 and replaces
8989
``empty_value``, which is available prior to 2.6.
9090

91-
**type**: ``string`` or ``array``
91+
**type**: ``string`` | ``array``
9292

9393
If your widget option is set to ``choice``, then this field will be represented
94-
as a series of ``select`` boxes. The ``placeholder`` option can be used
95-
to add a "blank" entry to the top of each select box::
94+
as a series of ``select`` boxes. When the placeholder value is a string,
95+
it will be used as the **blank value** of all select boxes::
9696

9797
$builder->add('dueDate', 'date', array(
98-
'placeholder' => '',
98+
'placeholder' => 'Select a value',
9999
));
100100

101-
Alternatively, you can specify a string to be displayed for the "blank" value::
101+
Alternatively, you can use an array that configures different placeholder
102+
values for the year, month and day fields::
102103

103104
$builder->add('dueDate', 'date', array(
104-
'placeholder' => array('year' => 'Year', 'month' => 'Month', 'day' => 'Day')
105+
'placeholder' => array(
106+
'year' => 'Year', 'month' => 'Month', 'day' => 'Day'
107+
)
105108
));
106109

107110
.. _reference-forms-type-date-format:

‎reference/forms/types/datetime.rst

Copy file name to clipboardExpand all lines: reference/forms/types/datetime.rst
+26-1Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,32 @@ date_widget
7171

7272
.. include:: /reference/forms/types/options/days.rst.inc
7373

74-
.. include:: /reference/forms/types/options/placeholder.rst.inc
74+
placeholder
75+
~~~~~~~~~~~
76+
77+
.. versionadded:: 2.6
78+
The ``placeholder`` option was introduced in Symfony 2.6 and replaces
79+
``empty_value``, which is available prior to 2.6.
80+
81+
**type**: ``string`` | ``array``
82+
83+
If your widget option is set to ``choice``, then this field will be represented
84+
as a series of ``select`` boxes. When the placeholder value is a string,
85+
it will be used as the **blank value** of all select boxes::
86+
87+
$builder->add('startDateTime', 'datetime', array(
88+
'placeholder' => 'Select a value',
89+
));
90+
91+
Alternatively, you can use an array that configures different placeholder
92+
values for the year, month, day, hour, minute and second fields::
93+
94+
$builder->add('startDateTime', 'datetime', array(
95+
'placeholder' => array(
96+
'year' => 'Year', 'month' => 'Month', 'day' => 'Day',
97+
'hour' => 'Hour', 'minute' => 'Minute', 'second' => 'Second',
98+
)
99+
));
75100

76101
format
77102
~~~~~~

‎reference/forms/types/time.rst

Copy file name to clipboardExpand all lines: reference/forms/types/time.rst
+25-1Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,31 @@ values.
7676
Field Options
7777
-------------
7878

79-
.. include:: /reference/forms/types/options/placeholder.rst.inc
79+
placeholder
80+
~~~~~~~~~~~
81+
82+
.. versionadded:: 2.6
83+
The ``placeholder`` option was introduced in Symfony 2.6 and replaces
84+
``empty_value``, which is available prior to 2.6.
85+
86+
**type**: ``string`` | ``array``
87+
88+
If your widget option is set to ``choice``, then this field will be represented
89+
as a series of ``select`` boxes. When the placeholder value is a string,
90+
it will be used as the **blank value** of all select boxes::
91+
92+
$builder->add('startTime', 'time', array(
93+
'placeholder' => 'Select a value',
94+
));
95+
96+
Alternatively, you can use an array that configures different placeholder
97+
values for the hour, minute and second fields::
98+
99+
$builder->add('startTime', 'time', array(
100+
'placeholder' => array(
101+
'hour' => 'Hour', 'minute' => 'Minute', 'second' => 'Second',
102+
)
103+
));
80104

81105
.. include:: /reference/forms/types/options/hours.rst.inc
82106

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.