Commit 236d866b authored by Klimov Paul's avatar Klimov Paul

Method `ActiveField::staticControl()` added

parent 34081f44
......@@ -289,6 +289,20 @@ class ActiveField extends \yii\widgets\ActiveField
return $this;
}
/**
* Renders Bootstrap static form control.
* @param array $options the tag options in terms of name-value pairs. These will be rendered as
* the attributes of the resulting tag. There are also a special options:
* - encode: boolean, whether value should be HTML-encoded or not.
* @return $this the field object itself
*/
public function staticControl($options = [])
{
$this->adjustLabelFor($options);
$this->parts['{input}'] = Html::activeStaticControl($this->model, $this->attribute, $options);
return $this;
}
/**
* @inheritdoc
*/
......
......@@ -97,4 +97,13 @@ class ActiveForm extends \yii\widgets\ActiveForm
}
parent::init();
}
/**
* @inheritdoc
* @return ActiveField the created ActiveField object
*/
public function field($model, $attribute, $options = [])
{
return parent::field($model, $attribute, $options);
}
}
......@@ -8,7 +8,6 @@
namespace yii\bootstrap;
use yii\helpers\ArrayHelper;
use yii\helpers\Html;
/**
* BaseHtml provides concrete implementation for [[Html]].
......
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