-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
3 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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( | ||
'attr' => array( | ||
'min' => 5, | ||
'max' => 50 | ||
) | ||
)); | ||
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/label_attr.rst.inc | ||
|
||
.. include:: /reference/forms/types/options/mapped.rst.inc | ||
|
||
.. include:: /reference/forms/types/options/required.rst.inc | ||
|
||
.. include:: /reference/forms/types/options/trim.rst.inc |