Merge pull request #169 from kamui545/patch-1

Adding support for url input
This commit is contained in:
ADmad 2011-08-10 08:10:25 -07:00
commit 8d8d64ac80
2 changed files with 9 additions and 0 deletions

View file

@ -7318,6 +7318,12 @@ class FormHelperTest extends CakeTestCase {
'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 file

@ -1072,6 +1072,9 @@ class FormHelper extends AppHelper {
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);
}