Skip to content

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

Merged
merged 5 commits into from
Jul 16, 2015
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions reference/forms/types/range.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
.. 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 | - `data`_ |
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add include for data option.

| options | - `disabled`_ |
| | - `empty_data`_ |
Copy link

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.

Copy link
Contributor Author

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 ?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EmailType and RangeType 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

Copy link
Contributor Author

@harikt harikt Jun 30, 2015 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

| | - `error_bubbling`_ |
| | - `error_mapping`_ |
| | - `label`_ |
| | - `label_attr`_ |
| | - `mapped`_ |
| | - `attr`_ |
| | - `required`_ |
+-------------+---------------------------------------------------------------------+
| Parent type | :doc:`text </reference/forms/types/text>` |
+-------------+---------------------------------------------------------------------+
| Class | :class:`Symfony\\Component\\Form\\Extension\\Core\\Type\\RangeType` |
+-------------+---------------------------------------------------------------------+

Basic Usage
-----------

$builder->add('name', 'range', array(
Copy link

Choose a reason for hiding this comment

The 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(

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure. Thanks.

'attr' => array(
'min' => 5,
'max' => 50
)
));

Copy link
Member

Choose a reason for hiding this comment

The 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/disabled.rst.inc

.. 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/read_only.rst.inc
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add read_only to inherited options list.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • read_only_ (deprecated as of 2.8) , do we need to add ? May be remove it from docs ?


.. include:: /reference/forms/types/options/required.rst.inc