<?php 
 
use yii\helpers\Html; 
use yii\bootstrap\ActiveForm; 
use \dmstr\bootstrap\Tabs; 
use yii\helpers\StringHelper; 
 
/** 
* @var yii\web\View $this 
* @var app\models\TestContacts $model 
* @var yii\widgets\ActiveForm $form 
* @var string $relAttributes relation fields names for disabling  
*/ 
 
?> 
 
<div class="test-contacts-form"> 
 
    <?php $form = ActiveForm::begin([ 
    'id' => 'TestContacts', 
    'layout' => 'horizontal', 
    'enableClientValidation' => true, 
    'errorSummaryCssClass' => 'error-summary alert alert-error' 
    ] 
    ); 
    ?> 
 
    <div class=""> 
        <?php $this->beginBlock('main'); ?> 
 
        <p> 
             
            <?= // generated by schmunk42\giiant\generators\crud\providers\RelationProvider::activeField 
$form->field($model, 'test_id')->dropDownList( 
    \yii\helpers\ArrayHelper::map(app\models\Test::find()->all(), 'id', 'name'), 
    [ 
        'prompt' => Yii::t('app', 'Select'), 
        'disabled' => (isset($relAttributes) && isset($relAttributes['test_id'])), 
    ] 
); ?> 
            <?= $form->field($model, 'phone')->textInput(['maxlength' => true]) ?> 
            <?= $form->field($model, 'email')->textInput(['maxlength' => true]) ?> 
        </p> 
        <?php $this->endBlock(); ?> 
         
        <?= 
    Tabs::widget( 
                 [ 
                   'encodeLabels' => false, 
                     'items' => [ [ 
    'label'   => Yii::t('app', StringHelper::basename('app\models\TestContacts')), 
    'content' => $this->blocks['main'], 
    'active'  => true, 
], ] 
                 ] 
    ); 
    ?> 
        <hr/> 
 
        <?php echo $form->errorSummary($model); ?> 
 
        <?= Html::submitButton( 
        '<span class="glyphicon glyphicon-check"></span> ' . 
        ($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Save')), 
        [ 
        'id' => 'save-' . $model->formName(), 
        'class' => 'btn btn-success' 
        ] 
        ); 
        ?> 
 
        <?php ActiveForm::end(); ?> 
 
    </div> 
 
</div> 
 
 
 |