* @since 2.0 */ class ActiveField extends \yii\widgets\ActiveField { /** * @var Generator */ public $model; public function init() { $stickyAttributes = $this->model->stickyAttributes(); if (in_array($this->attribute, $stickyAttributes)) { $this->sticky(); } $hints = $this->model->hints(); if (isset($hints[$this->attribute])) { $this->hint($hints[$this->attribute]); } } /** * Makes filed remember its value between page reloads * @return static the field object itself */ public function sticky() { $this->options['class'] .= ' sticky'; return $this; } }