Permalink
Browse files

Merge pull request #14 from k1LoW/master

Support array('div' => false) option
  • Loading branch information...
2 parents 4acf85f + 800376d commit e93b9e49ffd5e82518092278519928905a718dc5 @slywalker slywalker committed Feb 15, 2012
Showing with 8 additions and 1 deletion.
  1. +8 −1 View/Helper/BootstrapFormHelper.php
@@ -106,6 +106,9 @@ public function submit($caption = null, $options = array()) {
unset($options['div']);
$out = $this->Html->tag('button', $caption, $options);
+ if (!$divOptions) {
+ return $out;
+ }
$out = $this->Html->tag('div', $out, $divOptions);
return $out;
}
@@ -133,7 +136,7 @@ protected function _input($name, $options, &$hidden = '') {
} else {
$input = parent::input($name, $options);
if (!empty($options['multiple']) && $options['multiple'] === 'checkbox') {
- $input = $options['after'] . $this->_multipleCheckbox($input, $options, $hidden);
+ $input = $options['after'] . $this->_multipleCheckbox($input, $options, $hidden);
}
elseif ($options['type'] === 'radio') {
$input = $this->_radio($input, $options, $hidden);
@@ -161,6 +164,10 @@ protected function _clearfix($name, $input, $options) {
}
$out[] = parent::label(FALSE, $text, $options['label']);
}
+ if ($options['div'] === false) {
+ $out[] = $input;
+ return implode("\n", $out);
+ }
$out[] = $this->Html->div($options['div']['class'], $input, $options['div']);
$clearfix = 'control-group';

0 comments on commit e93b9e4

Please sign in to comment.