yii\widgets\ActiveForm::run PHP Метод

run() публичный метод

This registers the necessary JavaScript code and renders the form close tag.
public run ( )
    public function run()
    {
        if (!empty($this->_fields)) {
            throw new InvalidCallException('Each beginField() should have a matching endField() call.');
        }
        $content = ob_get_clean();
        echo Html::beginForm($this->action, $this->method, $this->options);
        echo $content;
        if ($this->enableClientScript) {
            $id = $this->options['id'];
            $options = Json::htmlEncode($this->getClientOptions());
            $attributes = Json::htmlEncode($this->attributes);
            $view = $this->getView();
            ActiveFormAsset::register($view);
            $view->registerJs("jQuery('#{$id}').yiiActiveForm({$attributes}, {$options});");
        }
        echo Html::endForm();
    }

Usage Example

Пример #1
0
 public function run()
 {
     parent::run();
     if ($this->append) {
         echo $this->append;
     }
 }
All Usage Examples Of yii\widgets\ActiveForm::run