8000 [Form] Added the 'range' FormType by jaytaph · Pull Request #12067 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Form] Added the 'range' FormType #12067

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

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
[Form] Added the 'range' FormType
  • Loading branch information
jaytaph committed Sep 27, 2014
commit 085d38557612319919b6b05241aab39b350b1a8b
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
8000
Original file line number Diff line number Diff line change
Expand Up @@ -1105,3 +1105,4 @@ Symfony2 is the result of the work of many people who made the code better
- Erik Saunier (snickers)
- Matej Žilák (teo_sk)
- Vladislav Vlastovskiy (vlastv)
- Joshua Thijssen (jaytaph)
Copy link
Contributor

Choose a reason for hiding this comment

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

this is auto-generated

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was not sure. Should I remove the line from the PR?

Copy link
Contributor

Choose a reason for hiding this comment

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

yes

Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,11 @@
{{- block('form_widget_simple') -}}
{%- endblock email_widget %}

{% block range_widget -%}
{% set type = type|default('range') %}
{{- block('form_widget_simple') -}}
{%- endblock range_widget %}

{% block button_widget -%}
{% if label is empty -%}
{% set label = name|humanize %}
Expand Down
3 changes: 3 additions & 0 deletions src/Symfony/Bundle/FrameworkBundle/Resources/config/form.xml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@
<service id="form.type.radio" class="Symfony\Component\Form\Extension\Core\Type\RadioType">
<tag name="form.type" alias="radio" />
</service>
<service id="form.type.range" class="Symfony\Component\Form\Extension\Core\Type\RangeType">
<tag name="form.type" alias="range" />
</service>
<service id="form.type.repeated" class="Symfony\Component\Form\Extension\Core\Type\RepeatedType">
<tag name="form.type" alias="repeated" />
</service>
Expand Down
8000
2 changes: 1 addition & 1 deletion src/Symfony/Component/Form/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ CHANGELOG

2.6.0
-----

* added "html5" option to Date, Time and DateTimeFormType to be able to
Copy link
Member

Choose a reason for hiding this comment

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

this line should not be removed

enable/disable HTML5 input date when widget option is "single_text"
* added the html5 "range" FormType

2.5.0
------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ protected function loadTypes()
new Type\PasswordType(),
new Type\PercentType(),
new Type\RadioType(),
new Type\RangeType(),
new Type\RepeatedType(),
new Type\SearchType(),
new Type\TextareaType(),
Expand Down
33 changes: 33 additions & 0 deletions src/Symfony/Component/Form/Extension/Core/Type/RangeType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Component\Form\Extension\Core\Type;

use Symfony\Component\Form\AbstractType;

class RangeType extends AbstractType
{
/**
* {@inheritdoc}
*/
public function getParent()
{
return 'text';
}

/**
* {@inheritdoc}
*/
public function getName()
{
return 'range';
}
}
0