$form = ActiveForm::begin(); ?> <?php echo $form->field($model, 'name')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'email')->widget(MaskedInput::classname(), ['clientOptions' => ['alias' => 'email']]); ?> <?php echo $form->field($model, 'birthdate')->widget(DatePicker::className(), ['inline' => true, 'template' => '<div class="well well-sm" style="background-color: #fff; width:250px">{input}</div>', 'language' => 'ru', 'clientOptions' => ['autoclose' => true, 'format' => 'yyyy-mm-dd']]); ?> <?php echo $form->field($model, 'level')->dropDownList(Student::getLevelsList()); ?> <div class="form-group"> <?php echo Html::submitButton($model->isNewRecord ? 'Добавить' : 'Сохранить', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']); ?> </div> <?php ActiveForm::end(); ?> </div>
<?php } ?> <?php if (!empty($teachersNames)) { ?> <h2>Учителя</h2> <ul> <li><h3><?php echo $teachersNames[0]; ?> </h3></li> <li><h3><?php echo $teachersNames[1]; ?> </h3></li> </ul> <h2>Ученики</h2> <?php } ?> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'name', 'email:email', ['attribute' => 'birthdate', 'value' => 'birthdate', 'format' => 'html', 'contentOptions' => ['style' => 'width:200px;']], ['attribute' => 'level', 'content' => function ($data) { return $data->getLevelName(); }, 'filter' => Student::getLevelsList()], ['class' => 'yii\\grid\\ActionColumn']]]); ?> </div>