Skip to content

Commit f4b7d7f

Browse files
committed
feature #5458 HTML5 range documentation (harikt)
This PR was merged into the 2.8 branch. Discussion ---------- HTML5 range documentation Hi, | Q | A | ------------- | --- | Doc fix? | yes | New feature? | yes | BC breaks? | no | Deprecations? | no | Fixed tickets | [#5439] | Code PR | [12607] | License | MIT I am trying to contribute to range added for the PR symfony/symfony#12067 & symfony/symfony#11979 which fixes #5439 . Need some help on moving for I am really new to the documentation. The current issues I feel is whether we need to add Basic usage or is that only reference ? I had a look at http://symfony.com/doc/current/reference/forms/types/number.html which would have been similar, but that seems it referencing to choice seems more confusing. I have looked into other types also and almost all are some what similar. Any input is highly appreciated and will work on in the free time. If someone is interested please do take the PR or finish it . Thank you. Commits ------- 2863079 Fix moving the mapped down as per @xabbuh abf3e8e Fix the rendering issue 3c6ff76 Fix issues reported by @snoek09 . Thank you. a2c3f21 Make the necessary changes mentioned by @xabbuh and add example for form d4d1f12 Starting with range documentation
2 parents 79a1902 + 2863079 commit f4b7d7f

File tree

3 files changed

+76
-0
lines changed

3 files changed

+76
-0
lines changed

Diff for: reference/forms/types.rst

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Form Types Reference
1818
types/percent
1919
types/search
2020
types/url
21+
types/range
2122

2223
types/choice
2324
types/entity

Diff for: reference/forms/types/map.rst.inc

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Text Fields
1111
* :doc:`percent </reference/forms/types/percent>`
1212
* :doc:`search </reference/forms/types/search>`
1313
* :doc:`url </reference/forms/types/url>`
14+
* :doc:`range </reference/forms/types/range>`
1415

1516
Choice Fields
1617
~~~~~~~~~~~~~

Diff for: reference/forms/types/range.rst

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
.. index::
2+
single: Forms; Fields; range
3+
4+
range Field Type
5+
================
6+
7+
The ``range`` field is a slider that is rendered using the HTML5
8+
``<input type="range" />`` tag.
9+
10+
+-------------+---------------------------------------------------------------------+
11+
| Rendered as | ``input`` ``range`` field (slider in HTML5 supported browser) |
12+
+-------------+---------------------------------------------------------------------+
13+
| Inherited | - `attr`_ |
14+
| options | - `data`_ |
15+
| | - `disabled`_ |
16+
| | - `empty_data`_ |
17+
| | - `error_bubbling`_ |
18+
| | - `error_mapping`_ |
19+
| | - `label`_ |
20+
| | - `label_attr`_ |
21+
| | - `mapped`_ |
22+
| | - `required`_ |
23+
| | - `trim`_ |
24+
+-------------+---------------------------------------------------------------------+
25+
| Parent type | :doc:`text </reference/forms/types/text>` |
26+
+-------------+---------------------------------------------------------------------+
27+
| Class | :class:`Symfony\\Component\\Form\\Extension\\Core\\Type\\RangeType` |
28+
+-------------+---------------------------------------------------------------------+
29+
30+
Basic Usage
31+
-----------
32+
33+
.. code-block:: php
34+
35+
$builder->add('name', 'range', array(
36+
'attr' => array(
37+
'min' => 5,
38+
'max' => 50
39+
)
40+
));
41+
42+
Inherited Options
43+
-----------------
44+
45+
These options inherit from the :doc:`form </reference/forms/types/form>`
46+
type:
47+
48+
.. include:: /reference/forms/types/options/attr.rst.inc
49+
50+
.. include:: /reference/forms/types/options/data.rst.inc
51+
52+
.. include:: /reference/forms/types/options/disabled.rst.inc
53+
54+
.. include:: /reference/forms/types/options/empty_data.rst.inc
55+
:end-before: DEFAULT_PLACEHOLDER
56+
57+
The default value is ``''`` (the empty string).
58+
59+
.. include:: /reference/forms/types/options/empty_data.rst.inc
60+
:start-after: DEFAULT_PLACEHOLDER
61+
62+
.. include:: /reference/forms/types/options/error_bubbling.rst.inc
63+
64+
.. include:: /reference/forms/types/options/error_mapping.rst.inc
65+
66+
.. include:: /reference/forms/types/options/label.rst.inc
67+
68+
.. include:: /reference/forms/types/options/label_attr.rst.inc
69+
70+
.. include:: /reference/forms/types/options/mapped.rst.inc
71+
72+
.. include:: /reference/forms/types/options/required.rst.inc
73+
74+
.. include:: /reference/forms/types/options/trim.rst.inc

0 commit comments

Comments
 (0)