Browse files

Merge pull request #169 from kamui545/patch-1

Adding support for url input
  • Loading branch information...
2 parents 9e2db27 + 2773450 commit 8d8d64ac80578c70c183171bdbe503b91a28f150 @ADmad ADmad committed Aug 10, 2011
Showing with 9 additions and 0 deletions.
  1. +6 −0 lib/Cake/Test/Case/View/Helper/FormHelperTest.php
  2. +3 −0 lib/Cake/View/Helper/FormHelper.php
View
6 lib/Cake/Test/Case/View/Helper/FormHelperTest.php
@@ -7318,6 +7318,12 @@ public function testHtml5Inputs() {
'input' => array('type' => 'text', 'name' => 'data[User][query]', 'id' => 'UserQuery', 'value' => 'test')
);
$this->assertTags($result, $expected);
+
+ $result = $this->Form->input('User.website', array('type' => 'url', 'value' => 'http://domain.tld', 'div' => false, 'label' => false));
+ $expected = array(
+ 'input' => array('type' => 'url', 'name' => 'data[User][website]', 'id' => 'UserWebsite', 'value' => 'http://domain.tld')
+ );
+ $this->assertTags($result, $expected);
}
/**
View
3 lib/Cake/View/Helper/FormHelper.php
@@ -1072,6 +1072,9 @@ public function input($fieldName, $options = array()) {
case 'textarea':
$input = $this->textarea($fieldName, $options + array('cols' => '30', 'rows' => '6'));
break;
+ case 'url':
+ $input = $this->text($fieldName, array('type' => 'url') + $options);
+ break;
default:
$input = $this->{$type}($fieldName, $options);
}

0 comments on commit 8d8d64a

Please sign in to comment.