Commit 20727c8c by Qiang Xue

Merge pull request #733 from wicaksono/master

Update radio and checkbox
parents 880b6f9d f756a45f
...@@ -570,7 +570,8 @@ class HtmlBase ...@@ -570,7 +570,8 @@ class HtmlBase
$label = $options['label']; $label = $options['label'];
$labelOptions = isset($options['labelOptions']) ? $options['labelOptions'] : array(); $labelOptions = isset($options['labelOptions']) ? $options['labelOptions'] : array();
unset($options['label'], $options['labelOptions']); unset($options['label'], $options['labelOptions']);
return $hidden . static::label(static::input('radio', $name, $value, $options) . ' ' . $label, null, $labelOptions); $content = static::label(static::input('radio', $name, $value, $options) . ' ' . $label, null, $labelOptions);
return $hidden . static::tag('div', $content, array('class' => 'radio'));
} else { } else {
return $hidden . static::input('radio', $name, $value, $options); return $hidden . static::input('radio', $name, $value, $options);
} }
...@@ -610,7 +611,8 @@ class HtmlBase ...@@ -610,7 +611,8 @@ class HtmlBase
$label = $options['label']; $label = $options['label'];
$labelOptions = isset($options['labelOptions']) ? $options['labelOptions'] : array(); $labelOptions = isset($options['labelOptions']) ? $options['labelOptions'] : array();
unset($options['label'], $options['labelOptions']); unset($options['label'], $options['labelOptions']);
return $hidden . static::label(static::input('checkbox', $name, $value, $options) . ' ' . $label, null, $labelOptions); $content = static::label(static::input('checkbox', $name, $value, $options) . ' ' . $label, null, $labelOptions);
return $hidden . static::tag('div', $content, array('class' => 'checkbox'));
} else { } else {
return $hidden . static::input('checkbox', $name, $value, $options); return $hidden . static::input('checkbox', $name, $value, $options);
} }
...@@ -760,7 +762,8 @@ class HtmlBase ...@@ -760,7 +762,8 @@ class HtmlBase
$lines[] = call_user_func($formatter, $index, $label, $name, $checked, $value); $lines[] = call_user_func($formatter, $index, $label, $name, $checked, $value);
} else { } else {
$checkbox = static::checkbox($name, $checked, array('value' => $value)); $checkbox = static::checkbox($name, $checked, array('value' => $value));
$lines[] = static::label($checkbox . ' ' . ($encode ? static::encode($label) : $label)); $content = static::label($checkbox . ' ' . ($encode ? static::encode($label) : $label));
$lines[] = static::tag('div', $content, array('class' => 'checkbox'));
} }
$index++; $index++;
} }
...@@ -817,7 +820,8 @@ class HtmlBase ...@@ -817,7 +820,8 @@ class HtmlBase
$lines[] = call_user_func($formatter, $index, $label, $name, $checked, $value); $lines[] = call_user_func($formatter, $index, $label, $name, $checked, $value);
} else { } else {
$radio = static::radio($name, $checked, array('value' => $value)); $radio = static::radio($name, $checked, array('value' => $value));
$lines[] = static::label($radio . ' ' . ($encode ? static::encode($label) : $label)); $content = static::label($radio . ' ' . ($encode ? static::encode($label) : $label));
$lines[] = static::tag('div', $content, array('class' => 'radio'));
} }
$index++; $index++;
} }
......
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