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
Prev Previous commit
Next Next commit
Added php template and range tests
  • Loading branch information
jaytaph committed Oct 3, 2014
commit 7294c2a652f78b205904683ddfc255e573dd1a1e
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?php echo $view['form']->block($form, 'form_widget_simple', array('type' => isset($type) ? $type : 'range')) ?>
1 change: 1 addition & 0 deletions src/Symfony/Component/Form/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ CHANGELOG

2.6.0
-----

* added "html5" option to Date, Time and DateTimeFormType to be able to
enable/disable HTML5 input date when widget option is "single_text"
* added the html5 "range" FormType
Expand Down
30 changes: 30 additions & 0 deletions src/Symfony/Component/Form/Tests/AbstractLayoutTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1347,6 +1347,36 @@ public function testLanguage()
);
}

public function testRange()
{
$form = $this->factory->createNamed('name', 'range', 42, array('attr' => array('min' => 5)));

$this->assertWidgetMatchesXpath($form->createView(), array(),
'/input
[@type="range"]
[@name="name"]
[@value=42]
[@min=5]
'
);
}

public function testRangeWithMinMaxValues()
{
$form = $this->factory->createNamed('name', 'range', 42, array('attr' => array('min' => 5, 'max' => 57)));

$this->assertWidgetMatchesXpath($form->createView(), array(),
'/input
[@type="range"]
[@name="name"]
[@value=42]
[@min=5]
[@max=57]
'
);
}


public function testLocale()
{
$form = $this->factory->createNamed('name', 'locale', 'de_AT');
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy