1
votes

I need to generate widgets\ActiveForm::field() without "form" tag at begin. I looked in source of yii\widgets\ActiveForm and found that this can not be avoided :(

public function init()
{
    if (!isset($this->options['id'])) {
        $this->options['id'] = $this->getId();
    }
    echo Html::beginForm($this->action, $this->method, $this->options);
}

Maybe there's another way to solve this problem without extending the 'ActiveForm' class?

1

1 Answers

1
votes

ActiveField is basically just a wrapper for yii\helpers\Html::active... methods so you just can call echo yii\helpers\Html::activeTextInput($model, $attribute, $options); without using ActiveForm