Commit 08d4d899 by Qiang Xue

Fixes #2914: `ActiveForm::fieldConfig` will be merged recursively with the…

Fixes #2914: `ActiveForm::fieldConfig` will be merged recursively with the `$options` parameter in `ActiveForm::field()`
parent ef4d5e48
......@@ -219,6 +219,7 @@ Yii Framework 2 Change Log
- Chg #2380: `yii\widgets\ActiveForm` will register validation js even if there are not fields inside (qiangxue)
- Chg #2898: `yii\console\controllers\AssetController` is now using hashes instead of timestamps (samdark)
- Chg #2913: RBAC `DbManager` is now initialized via migration (samdark)
- Chg #2914: `ActiveForm::fieldConfig` will be merged recursively with the `$options` parameter in `ActiveForm::field()` (qiangxue)
- Chg #3036: Upgraded Twitter Bootstrap to 3.1.x (qiangxue)
- Chg #3175: InvalidCallException, InvalidParamException, UnknownMethodException are now extended from SPL BadMethodCallException (samdark)
- Chg #3358: Removed automatic CSRF meta tag generation by `View`. Added `Html::csrfMetaTags()` and its call to main layout files (qiangxue)
......
......@@ -11,13 +11,14 @@ use Yii;
use yii\base\InvalidCallException;
use yii\base\Widget;
use yii\base\Model;
use yii\helpers\ArrayHelper;
use yii\helpers\Url;
use yii\helpers\Html;
use yii\helpers\Json;
use yii\web\JsExpression;
/**
* ActiveForm ...
* ActiveForm is a widget that builds an interactive HTML form for one or multiple data models.
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0
......@@ -64,9 +65,11 @@ class ActiveForm extends Widget
* function ($model, $attribute)
* ```
*
* The value of this property will be merged recursively with the `$options` parameter passed to [[field()]].
*
* @see fieldClass
*/
public $fieldConfig;
public $fieldConfig = [];
/**
* @var boolean whether to perform encoding on the error summary.
*/
......@@ -329,7 +332,7 @@ class ActiveForm extends Widget
if (!isset($config['class'])) {
$config['class'] = $this->fieldClass;
}
return Yii::createObject(array_merge($config, $options, [
return Yii::createObject(ArrayHelper::merge($config, $options, [
'model' => $model,
'attribute' => $attribute,
'form' => $this,
......
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