_form.php 1.39 KB
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use \yii\helpers\ArrayHelper;
use \common\models\TeamGroup;
/* @var $this yii\web\View */
/* @var $model common\models\Team */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="team-form">

    <?php $form = ActiveForm::begin(); ?>

    <?= $form->field($model, 'email')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'group_id')->textInput() ?>
    <?= $form->field($model, 'group_id')->dropDownList(ArrayHelper::map(TeamGroup::find()->all(), 'id', 'name'), ['prompt' => 'Выберие группу']) ?>
    <?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>


    <?= \backend\components\ImageUploader::widget([
        'model'=> $model,
        'field'=>'img',
        'width'=>120,
        'height'=>120,
        'multi'=>false,
        'gallery' =>$model->img,
        'name' => 'Загрузить картинку'
    ]); ?>

    <?= $form->field($model, 'phone')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'skype')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'code')->textInput(['maxlength' => true]) ?>

    <div class="form-group">
        <?= Html::submitButton($model->isNewRecord ? 'Добавить' : 'Редактировать', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
    </div>

    <?php ActiveForm::end(); ?>

</div>