src/widget/ActiveForm.php
public function run()
    {
        if (!empty($this->_fields)) {
            throw new InvalidCallException('Each beginField() should have a matching endField() call.');
        }

        $id = $this->options['id'];
        $options = Json::encode($this->getClientOptions());
        $attributes = Json::encode($this->attributes);
        $view = $this->getView();
        AdminUiActiveForm::register($view);
        $view->registerJs("jQuery('#$id').yiiActiveForm($attributes, $options);");

        echo Html::endForm();
    }
public function run()
    {
        if (!empty($this->_fields)) {
            throw new InvalidCallException('Each beginField() should have a matching endField() call.');
        }

        $id = $this->options['id'];
        $options = Json::encode($this->getClientOptions());
        $attributes = Json::encode($this->attributes);
        $view = $this->getView();
        AdminUiActiveForm::register($view);
        $view->registerJs("jQuery('#$id').yiiActiveForm($attributes, $options);");

        echo Html::endForm();
    }
Runs the widget.
This registers the necessary javascript code and renders the form close tag.
@throws InvalidCallException if `beginField()` and `endField()` calls are not matching