Skip to content

Commit

Permalink
Correção na exibição de checkbox
Browse files Browse the repository at this point in the history
  • Loading branch information
Erik Figueiredo committed May 2, 2016
1 parent 47af2bd commit b35dd58
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/View/Helper/FormHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,10 @@ public function input($fieldName, array $options = []) {
];
$options = $this->_parseOptions($fieldName, $options);
$options += ['id' => $this->_domId($fieldName)];
$finalClasses = 'form-control';
switch ($options['type']) {
case 'checkbox':
$finalClasses = '';
$options['templates']['checkboxWrapper'] = '<div class="checkbox"><label>{{input}}{{label}}</label></div>';
$options['templates']['label'] = '{{text}}';
break;
Expand All @@ -68,7 +70,7 @@ public function input($fieldName, array $options = []) {
break;
default:
}
return parent::input($fieldName, $this->_injectStyles($options, 'form-control'));
return parent::input($fieldName, $this->_injectStyles($options, $finalClasses));
}

public function select($fieldName, $options = [], array $attributes = [])
Expand Down Expand Up @@ -196,4 +198,4 @@ public function __call($method, $params)
return $this->widget($options['type'], $options);
}

}
}

0 comments on commit b35dd58

Please sign in to comment.