mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-04 02:22:39 +00:00
Make button type nullable.
Fixes #GH365
This commit is contained in:
parent
d46127e3ad
commit
afecb713ab
3 changed files with 5 additions and 2 deletions
|
@ -5897,6 +5897,9 @@ class FormHelperTest extends CakeTestCase {
|
|||
$result = $this->Form->button('<Clear Form>', array('type' => 'reset', 'escape' => true));
|
||||
$this->assertTags($result, array('button' => array('type' => 'reset'), '<Clear Form>', '/button'));
|
||||
|
||||
$result = $this->Form->button('No type', array('type' => false));
|
||||
$this->assertTags($result, array('button' => array(), 'No type', '/button'));
|
||||
|
||||
$result = $this->Form->button('Upload Text', array('onClick' => "$('#postAddForm').ajaxSubmit({target: '#postTextUpload', url: '/posts/text'});return false;'", 'escape' => false));
|
||||
$this->assertNotRegExp('/\&039/', $result);
|
||||
}
|
||||
|
|
|
@ -1548,7 +1548,7 @@ class FormHelper extends AppHelper {
|
|||
$name = str_replace(array('[', ']'), array('.', ''), $options['name']);
|
||||
$this->_secure($options['secure'], $name);
|
||||
}
|
||||
return $this->Html->useTag('button', $options['type'], array_diff_key($options, array('type' => '')), $title);
|
||||
return $this->Html->useTag('button', $options, $title);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -69,7 +69,7 @@ class HtmlHelper extends AppHelper {
|
|||
'file_no_model' => '<input type="file" name="%s" %s/>',
|
||||
'submit' => '<input %s/>',
|
||||
'submitimage' => '<input type="image" src="%s" %s/>',
|
||||
'button' => '<button type="%s"%s>%s</button>',
|
||||
'button' => '<button%s>%s</button>',
|
||||
'image' => '<img src="%s" %s/>',
|
||||
'tableheader' => '<th%s>%s</th>',
|
||||
'tableheaderrow' => '<tr%s>%s</tr>',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue