-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
HTML5 range documentation #5458
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 4 commits
d4d1f12
a2c3f21
3c6ff76
abf3e8e
2863079
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 |
---|---|---|
|
@@ -18,6 +18,7 @@ Form Types Reference | |
types/percent | ||
types/search | ||
types/url | ||
types/range | ||
|
||
types/choice | ||
types/entity | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
.. index:: | ||
single: Forms; Fields; range | ||
|
||
range Field Type | ||
================ | ||
|
||
The ``range`` field is a slider that is rendered using the HTML5 | ||
``<input type="range" />`` tag. | ||
|
||
+-------------+---------------------------------------------------------------------+ | ||
| Rendered as | ``input`` ``range`` field (slider in HTML5 supported browser) | | ||
+-------------+---------------------------------------------------------------------+ | ||
| Inherited | - `attr`_ | | ||
| options | - `data`_ | | ||
| | - `disabled`_ | | ||
| | - `empty_data`_ | | ||
| | - `error_bubbling`_ | | ||
| | - `error_mapping`_ | | ||
| | - `label`_ | | ||
| | - `label_attr`_ | | ||
| | - `mapped`_ | | ||
| | - `required`_ | | ||
| | - `trim`_ | | ||
+-------------+---------------------------------------------------------------------+ | ||
| Parent type | :doc:`text </reference/forms/types/text>` | | ||
+-------------+---------------------------------------------------------------------+ | ||
| Class | :class:`Symfony\\Component\\Form\\Extension\\Core\\Type\\RangeType` | | ||
+-------------+---------------------------------------------------------------------+ | ||
|
||
Basic Usage | ||
----------- | ||
|
||
.. code-block:: php | ||
|
||
$builder->add('name', 'range', array( | ||
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. Please add a code-block directive before the example code: .. code-block:: php
$builder->add('name', 'range', array( 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. sure. Thanks. |
||
'attr' => array( | ||
'min' => 5, | ||
'max' => 50 | ||
) | ||
)); | ||
|
||
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. Please remove one of the blank lines. |
||
Inherited Options | ||
----------------- | ||
|
||
These options inherit from the :doc:`form </reference/forms/types/form>` | ||
type: | ||
|
||
.. include:: /reference/forms/types/options/attr.rst.inc | ||
|
||
.. include:: /reference/forms/types/options/data.rst.inc | ||
|
||
.. include:: /reference/forms/types/options/disabled.rst.inc | ||
|
||
.. include:: /reference/forms/types/options/empty_data.rst.inc | ||
:end-before: DEFAULT_PLACEHOLDER | ||
|
||
The default value is ``''`` (the empty string). | ||
|
||
.. include:: /reference/forms/types/options/empty_data.rst.inc | ||
:start-after: DEFAULT_PLACEHOLDER | ||
|
||
.. include:: /reference/forms/types/options/error_bubbling.rst.inc | ||
|
||
.. include:: /reference/forms/types/options/error_mapping.rst.inc | ||
|
||
.. include:: /reference/forms/types/options/label.rst.inc | ||
|
||
.. include:: /reference/forms/types/options/mapped.rst.inc | ||
|
||
.. include:: /reference/forms/types/options/label_attr.rst.inc | ||
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. This description should be moved before the |
||
|
||
.. include:: /reference/forms/types/options/required.rst.inc | ||
|
||
.. include:: /reference/forms/types/options/trim.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.
Please add include for
empty_data
option.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.
Hey @snoek09 actually I have a question regarding the inherited options and include. I actually copied this from
email.rst
or something I guess. So is it all the properties of the text field for it is parent the properties are imported ?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.
EmailType
andRangeType
both have the same type as a parent; text (TextType
).The parent type of text is form (
FormType
).The inherited options are from this form type:
http://symfony.com/doc/current/reference/forms/types/text.html
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.