Skip to content

Commit

Permalink
feature #5458 HTML5 range documentation (harikt)
Browse files Browse the repository at this point in the history
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
weaverryan committed Jul 16, 2015
2 parents 79a1902 + 2863079 commit f4b7d7f
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 0 deletions.
1 change: 1 addition & 0 deletions reference/forms/types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Form Types Reference
types/percent
types/search
types/url
types/range

types/choice
types/entity
Expand Down
1 change: 1 addition & 0 deletions reference/forms/types/map.rst.inc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Text Fields
* :doc:`percent </reference/forms/types/percent>`
* :doc:`search </reference/forms/types/search>`
* :doc:`url </reference/forms/types/url>`
* :doc:`range </reference/forms/types/range>`

Choice Fields
~~~~~~~~~~~~~
Expand Down
74 changes: 74 additions & 0 deletions reference/forms/types/range.rst
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

0 comments on commit f4b7d7f

Please sign in to comment.