From d4d1f122f674bb1094b227fafe14b8a0a7de9005 Mon Sep 17 00:00:00 2001 From: Hari KT Date: Sun, 28 Jun 2015 13:30:49 +0530 Subject: [PATCH 1/5] Starting with range documentation --- reference/forms/types/range.rst | 56 +++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 reference/forms/types/range.rst diff --git a/reference/forms/types/range.rst b/reference/forms/types/range.rst new file mode 100644 index 00000000000..8be30c3f639 --- /dev/null +++ b/reference/forms/types/range.rst @@ -0,0 +1,56 @@ +.. index:: + single: Forms; Fields; range + +range Field Type +================ + +The ``range`` field is a slider that is rendered using the HTML5 +```` tag. + ++-------------+---------------------------------------------------------------------+ +| Rendered as | ``input`` ``range`` field (slider in html5 supported browser) | ++-------------+---------------------------------------------------------------------+ +| Inherited | - `data`_ | +| options | - `disabled`_ | +| | - `empty_data`_ | +| | - `error_bubbling`_ | +| | - `error_mapping`_ | +| | - `label`_ | +| | - `label_attr`_ | +| | - `mapped`_ | +| | - `max`_ | +| | - `min`_ | +| | - `required`_ | ++-------------+---------------------------------------------------------------------+ +| Parent type | :doc:`text ` | ++-------------+---------------------------------------------------------------------+ +| Class | :class:`Symfony\\Component\\Form\\Extension\\Core\\Type\\RangeType` | ++-------------+---------------------------------------------------------------------+ + +Basic Usage +----------- + + +Inherited Options +----------------- + +These options inherit from the :doc:`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 + +.. include:: /reference/forms/types/options/required.rst.inc From a2c3f210e8c59d034a51c444d6eb3c5a34fb531a Mon Sep 17 00:00:00 2001 From: Hari KT Date: Sun, 28 Jun 2015 22:07:10 +0530 Subject: [PATCH 2/5] Make the necessary changes mentioned by @xabbuh and add example for form --- reference/forms/types/range.rst | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/reference/forms/types/range.rst b/reference/forms/types/range.rst index 8be30c3f639..f2857c99eee 100644 --- a/reference/forms/types/range.rst +++ b/reference/forms/types/range.rst @@ -8,7 +8,7 @@ The ``range`` field is a slider that is rendered using the HTML5 ```` tag. +-------------+---------------------------------------------------------------------+ -| Rendered as | ``input`` ``range`` field (slider in html5 supported browser) | +| Rendered as | ``input`` ``range`` field (slider in HTML5 supported browser) | +-------------+---------------------------------------------------------------------+ | Inherited | - `data`_ | | options | - `disabled`_ | @@ -18,8 +18,7 @@ The ``range`` field is a slider that is rendered using the HTML5 | | - `label`_ | | | - `label_attr`_ | | | - `mapped`_ | -| | - `max`_ | -| | - `min`_ | +| | - `attr`_ | | | - `required`_ | +-------------+---------------------------------------------------------------------+ | Parent type | :doc:`text ` | @@ -30,6 +29,12 @@ The ``range`` field is a slider that is rendered using the HTML5 Basic Usage ----------- + $builder->add('name', 'range', array( + 'attr' => array( + 'min' => 5, + 'max' => 50 + ) + )); Inherited Options ----------------- From 3c6ff76053f79646d581482018a64d4c838104c9 Mon Sep 17 00:00:00 2001 From: Hari KT Date: Fri, 3 Jul 2015 17:02:29 +0530 Subject: [PATCH 3/5] Fix issues reported by @snoek09 . Thank you. --- reference/forms/types.rst | 1 + reference/forms/types/map.rst.inc | 1 + reference/forms/types/range.rst | 23 +++++++++++++++++------ 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/reference/forms/types.rst b/reference/forms/types.rst index 413c5bc2bc4..5df657d1910 100644 --- a/reference/forms/types.rst +++ b/reference/forms/types.rst @@ -18,6 +18,7 @@ Form Types Reference types/percent types/search types/url + types/range types/choice types/entity diff --git a/reference/forms/types/map.rst.inc b/reference/forms/types/map.rst.inc index b4362b3f318..2fbc4ae1f4d 100644 --- a/reference/forms/types/map.rst.inc +++ b/reference/forms/types/map.rst.inc @@ -11,6 +11,7 @@ Text Fields * :doc:`percent ` * :doc:`search ` * :doc:`url ` +* :doc:`url ` Choice Fields ~~~~~~~~~~~~~ diff --git a/reference/forms/types/range.rst b/reference/forms/types/range.rst index f2857c99eee..750b07d760a 100644 --- a/reference/forms/types/range.rst +++ b/reference/forms/types/range.rst @@ -10,16 +10,17 @@ The ``range`` field is a slider that is rendered using the HTML5 +-------------+---------------------------------------------------------------------+ | Rendered as | ``input`` ``range`` field (slider in HTML5 supported browser) | +-------------+---------------------------------------------------------------------+ -| Inherited | - `data`_ | -| options | - `disabled`_ | +| Inherited | - `attr`_ | +| options | - `data`_ | +| | - `disabled`_ | | | - `empty_data`_ | | | - `error_bubbling`_ | | | - `error_mapping`_ | | | - `label`_ | | | - `label_attr`_ | | | - `mapped`_ | -| | - `attr`_ | | | - `required`_ | +| | - `trim`_ | +-------------+---------------------------------------------------------------------+ | Parent type | :doc:`text ` | +-------------+---------------------------------------------------------------------+ @@ -29,6 +30,8 @@ The ``range`` field is a slider that is rendered using the HTML5 Basic Usage ----------- +.. code-block:: php + $builder->add('name', 'range', array( 'attr' => array( 'min' => 5, @@ -44,18 +47,26 @@ 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/read_only.rst.inc +.. include:: /reference/forms/types/options/label_attr.rst.inc .. include:: /reference/forms/types/options/required.rst.inc From abf3e8eed4d268e0552c4e21f5fe508a58ebe355 Mon Sep 17 00:00:00 2001 From: Hari KT Date: Fri, 3 Jul 2015 17:10:38 +0530 Subject: [PATCH 4/5] Fix the rendering issue --- reference/forms/types/map.rst.inc | 2 +- reference/forms/types/range.rst | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/reference/forms/types/map.rst.inc b/reference/forms/types/map.rst.inc index 2fbc4ae1f4d..de0e07db282 100644 --- a/reference/forms/types/map.rst.inc +++ b/reference/forms/types/map.rst.inc @@ -11,7 +11,7 @@ Text Fields * :doc:`percent ` * :doc:`search ` * :doc:`url ` -* :doc:`url ` +* :doc:`range ` Choice Fields ~~~~~~~~~~~~~ diff --git a/reference/forms/types/range.rst b/reference/forms/types/range.rst index 750b07d760a..7fe92d88b39 100644 --- a/reference/forms/types/range.rst +++ b/reference/forms/types/range.rst @@ -70,3 +70,5 @@ The default value is ``''`` (the empty string). .. include:: /reference/forms/types/options/label_attr.rst.inc .. include:: /reference/forms/types/options/required.rst.inc + +.. include:: /reference/forms/types/options/trim.rst.inc From 28630799385ea0a16cbd3ea18e0cc9fb595b131a Mon Sep 17 00:00:00 2001 From: Hari KT Date: Sat, 4 Jul 2015 12:03:51 +0530 Subject: [PATCH 5/5] Fix moving the mapped down as per @xabbuh --- reference/forms/types/range.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/forms/types/range.rst b/reference/forms/types/range.rst index 7fe92d88b39..31795c809d1 100644 --- a/reference/forms/types/range.rst +++ b/reference/forms/types/range.rst @@ -65,10 +65,10 @@ The default value is ``''`` (the empty string). .. include:: /reference/forms/types/options/label.rst.inc -.. include:: /reference/forms/types/options/mapped.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