Skip to content

Commit

Permalink
Merge pull request #169 from kamui545/patch-1
Browse files Browse the repository at this point in the history
Adding support for url input
  • Loading branch information
ADmad committed Aug 10, 2011
2 parents 9e2db27 + 2773450 commit 8d8d64a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/Cake/Test/Case/View/Helper/FormHelperTest.php
Expand Up @@ -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);
}

/**
Expand Down
3 changes: 3 additions & 0 deletions lib/Cake/View/Helper/FormHelper.php
Expand Up @@ -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);
}
Expand Down

0 comments on commit 8d8d64a

Please sign in to comment.