Commit 774ae2e1 authored by Qiang Xue's avatar Qiang Xue

Merge branch 'master' into new-asset

Conflicts:
	apps/basic/composer.json
	composer.json
parents 1ff89de2 a3ab453a
......@@ -248,10 +248,13 @@ class ActiveField extends \yii\widgets\ActiveField
}
if (!isset($options['itemOptions'])) {
$options['itemOptions'] = [
'container' => false,
'labelOptions' => ['class' => 'checkbox-inline'],
];
}
} elseif (!isset($options['item'])) {
$options['item'] = function ($index, $label, $name, $checked, $value) {
return '<div class="checkbox">' . Html::checkbox($name, $checked, ['label' => $label, 'value' => $value]) . '</div>';
};
}
parent::checkboxList($items, $options);
return $this;
......@@ -271,10 +274,13 @@ class ActiveField extends \yii\widgets\ActiveField
}
if (!isset($options['itemOptions'])) {
$options['itemOptions'] = [
'container' => false,
'labelOptions' => ['class' => 'radio-inline'],
];
}
} elseif (!isset($options['item'])) {
$options['item'] = function ($index, $label, $name, $checked, $value) {
return '<div class="radio">' . Html::radio($name, $checked, ['label' => $label, 'value' => $value]) . '</div>';
};
}
parent::radioList($items, $options);
return $this;
......
......@@ -65,6 +65,11 @@ use yii\base\InvalidConfigException;
*/
class ActiveForm extends \yii\widgets\ActiveForm
{
/**
* @var string the default field class name when calling [[field()]] to create a new field.
* @see fieldConfig
*/
public $fieldClass = 'yii\bootstrap\ActiveField';
/**
* @var array HTML attributes for the form tag. Default is `['role' => 'form']`.
*/
......@@ -91,9 +96,6 @@ class ActiveForm extends \yii\widgets\ActiveForm
if ($this->layout !== 'default') {
Html::addCssClass($this->options, 'form-' . $this->layout);
}
if (!isset($this->fieldConfig['class'])) {
$this->fieldConfig['class'] = ActiveField::className();
}
parent::init();
}
}
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