public function begin()
    {
        if ($this->form->enableClientScript) {
            $clientOptions = $this->getClientOptions();
            if (!empty($clientOptions)) {
                $this->form->attributes[] = $clientOptions;
            }
        }

        $inputID = $this->getInputId();
        $attribute = Html::getAttributeName($this->attribute);
        $options = $this->options;
        $class = isset($options['class']) ? (array) $options['class'] : [];
        $class[] = "field-$inputID";
        if ($this->model->isAttributeRequired($attribute)) {
            $class[] = $this->form->requiredCssClass;
        }
        $options['class'] = implode(' ', $class);
        if ($this->form->validationStateOn === ActiveForm::VALIDATION_STATE_ON_CONTAINER) {
            $this->addErrorClassIfNeeded($options);
        }
        $tag = ArrayHelper::remove($options, 'tag', 'div');

        return Html::beginTag($tag, $options);
    }
public function begin()
    {
        if ($this->form->enableClientScript) {
            $clientOptions = $this->getClientOptions();
            if (!empty($clientOptions)) {
                $this->form->attributes[] = $clientOptions;
            }
        }

        $inputID = $this->getInputId();
        $attribute = Html::getAttributeName($this->attribute);
        $options = $this->options;
        $class = isset($options['class']) ? (array) $options['class'] : [];
        $class[] = "field-$inputID";
        if ($this->model->isAttributeRequired($attribute)) {
            $class[] = $this->form->requiredCssClass;
        }
        $options['class'] = implode(' ', $class);
        if ($this->form->validationStateOn === ActiveForm::VALIDATION_STATE_ON_CONTAINER) {
            $this->addErrorClassIfNeeded($options);
        }
        $tag = ArrayHelper::remove($options, 'tag', 'div');

        return Html::beginTag($tag, $options);
    }
public function begin ( ) { if ( $ this -> form -> enableClientScript ) { $ clientOptions = $ this -> getClientOptions ( ) ; if ( ! empty ( $ clientOptions ) ) { $ this -> form -> attributes [ ] = $ clientOptions ; } } $ inputID = $ this -> getInputId ( ) ; $ attribute = Html :: getAttributeName ( $ this -> attribute ) ; $ options = $ this -> options ; $ class = isset ( $ options [ 'class' ] ) ? ( array ) $ options [ 'class' ] : [ ] ; $ class [ ] = "field-$inputID" ; if ( $ this -> model -> isAttributeRequired ( $ attribute ) ) { $ class [ ] = $ this -> form -> requiredCssClass ; } $ options [ 'class' ] = implode ( ' ' , $ class ) ; if ( $ this -> form -> validationStateOn === ActiveForm :: VALIDATION_STATE_ON_CONTAINER ) { $ this -> addErrorClassIfNeeded ( $ options ) ; } $ tag = ArrayHelper :: remove ( $ options , 'tag' , 'div' ) ; return Html :: beginTag ( $ tag , $ options ) ; }
Renders the opening tag of the field container.
@return string the rendering result.
Renders the opening tag of the field container .