-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
add separate placeholder examples for birthday, datetime and time type #6206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
b3aed28
83ed1fe
aa19d9c
a921c11
43e1bc4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,7 +67,30 @@ type: | |
|
||
.. include:: /reference/forms/types/options/days.rst.inc | ||
|
||
.. include:: /reference/forms/types/options/placeholder.rst.inc | ||
placeholder | ||
~~~~~~~~~~~ | ||
|
||
.. versionadded:: 2.6 | ||
The ``placeholder`` option was introduced in Symfony 2.6 and replaces | ||
``empty_value``, which is available prior to 2.6. | ||
|
||
**type**: ``string`` or ``array`` | ||
|
||
If your widget option is set to ``choice``, then this field will be represented | ||
as a series of ``select`` boxes. The ``placeholder`` option can be used | ||
to add a "blank" entry to the top of each select box:: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would put this a bit more generic saying something like "when the placeholder is a string, it will be used as the blank value of all select boxes: [....] Alternatively, you can use an array that configures different placeholder values for the day, month and year fields." There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I got the text from the DateType placeholder documentation. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that would a good idea as it makes things a bit more clear. |
||
|
||
$builder->add('birthdate', 'birthday', array( | ||
'placeholder' => '', | ||
)); | ||
|
||
Alternatively, you can specify a string to be displayed for the "blank" value:: | ||
|
||
$builder->add('birthdate', 'birthday', array( | ||
'placeholder' => array( | ||
'year' => 'Year', 'month' => 'Month', 'day' => 'Day', | ||
) | ||
)); | ||
|
||
.. include:: /reference/forms/types/options/date_format.rst.inc | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we use
string`` | ``array
instead of "or" in the rest of the reference as far as I know.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. It was only used in the DateType placeholder documentation.