mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 11:06:15 +00:00
Merge pull request #169 from kamui545/patch-1
Adding support for url input
This commit is contained in:
commit
8d8d64ac80
2 changed files with 9 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue