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