Render Form inside Yii2 Gui Tab -
my application have have multiple language, decided separate each language using tab (yii2 gui), how can render form in side 'content' key?
<?php $language_tab=[]; $increment=0; $content="i love you"; foreach($language $obj){ $language_tab[$increment] = array('label' => $obj->name ,'content' => $content); $increment++; } echo tabs::widget([ 'items' => $language_tab, 'options' => ['tag' => 'div'], 'itemoptions' => ['tag' => 'div'], 'headeroptions' => ['class' => 'my-class'], 'clientoptions' => ['collapsible' => false], ]); ?> <div class="status-form"> <?php $form = activeform::begin(); ?> <?= $form->field($model, 'name')->textinput(['maxlength' => true]) ?> <?= $form->field($model, 'date_created')->textinput() ?> <div class="form-group"> <?= html::submitbutton($model->isnewrecord ? 'create' : 'update', ['class' => $model->isnewrecord ? 'btn btn-success' : 'btn btn-primary']) ?> </div> <?php activeform::end(); ?> </div>
i wanna change $content form below. please help!!!
you may create separate view form , render it:
... 'content' => $this->render('_language_form', ['language' => $obj, 'model' => $model]), ...
Comments
Post a Comment