Commit d63613b6 by Qiang Xue

Merge pull request #3285 from mikehaertl/master

Fix bootstrap templates
parents 1ed02180 9d384668
...@@ -173,6 +173,9 @@ class ActiveField extends \yii\widgets\ActiveField ...@@ -173,6 +173,9 @@ class ActiveField extends \yii\widgets\ActiveField
} else { } else {
$this->template = "<div class=\"checkbox\">\n{beginLabel}\n{input}\n{labelTitle}\n{endLabel}\n{error}\n{hint}\n</div>"; $this->template = "<div class=\"checkbox\">\n{beginLabel}\n{input}\n{labelTitle}\n{endLabel}\n{error}\n{hint}\n</div>";
} }
} else {
$this->template = $options['template'];
unset($options['template']);
} }
$this->labelOptions['class'] = null; $this->labelOptions['class'] = null;
} }
...@@ -189,6 +192,9 @@ class ActiveField extends \yii\widgets\ActiveField ...@@ -189,6 +192,9 @@ class ActiveField extends \yii\widgets\ActiveField
if ($this->inline) { if ($this->inline) {
if (!isset($options['template'])) { if (!isset($options['template'])) {
$this->template = "{label}\n{beginWrapper}\n{input}\n{error}\n{endWrapper}\n{hint}"; $this->template = "{label}\n{beginWrapper}\n{input}\n{error}\n{endWrapper}\n{hint}";
} else {
$this->template = $options['template'];
unset($options['template']);
} }
if (!isset($options['itemOptions'])) { if (!isset($options['itemOptions'])) {
$options['itemOptions'] = [ $options['itemOptions'] = [
...@@ -209,6 +215,9 @@ class ActiveField extends \yii\widgets\ActiveField ...@@ -209,6 +215,9 @@ class ActiveField extends \yii\widgets\ActiveField
if ($this->inline) { if ($this->inline) {
if (!isset($options['template'])) { if (!isset($options['template'])) {
$this->template = "{label}\n{beginWrapper}\n{input}\n{error}\n{endWrapper}\n{hint}"; $this->template = "{label}\n{beginWrapper}\n{input}\n{error}\n{endWrapper}\n{hint}";
} else {
$this->template = $options['template'];
unset($options['template']);
} }
if (!isset($options['itemOptions'])) { if (!isset($options['itemOptions'])) {
$options['itemOptions'] = [ $options['itemOptions'] = [
......
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