Commit 09395ed2 by Qiang Xue

Merge pull request #4974 from creocoder/html-button-type-fix

Html::button() type is `button` by default
parents 26526ff0 ed251d89
...@@ -425,6 +425,9 @@ class BaseHtml ...@@ -425,6 +425,9 @@ class BaseHtml
*/ */
public static function button($content = 'Button', $options = []) public static function button($content = 'Button', $options = [])
{ {
if (!isset($options['type'])) {
$options['type'] = 'button';
}
return static::tag('button', $content, $options); return static::tag('button', $content, $options);
} }
...@@ -1541,7 +1544,7 @@ class BaseHtml ...@@ -1541,7 +1544,7 @@ class BaseHtml
$groups = isset($tagOptions['groups']) ? $tagOptions['groups'] : []; $groups = isset($tagOptions['groups']) ? $tagOptions['groups'] : [];
unset($tagOptions['prompt'], $tagOptions['options'], $tagOptions['groups']); unset($tagOptions['prompt'], $tagOptions['options'], $tagOptions['groups']);
$options['encodeSpaces'] = ArrayHelper::getValue($options, 'encodeSpaces', $encodeSpaces); $options['encodeSpaces'] = ArrayHelper::getValue($options, 'encodeSpaces', $encodeSpaces);
foreach ($items as $key => $value) { foreach ($items as $key => $value) {
if (is_array($value)) { if (is_array($value)) {
$groupAttrs = isset($groups[$key]) ? $groups[$key] : []; $groupAttrs = isset($groups[$key]) ? $groups[$key] : [];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment