skill category

This commit is contained in:
andrey
2021-06-08 17:05:54 +03:00
parent 9f1db817a5
commit 23773eff4e
13 changed files with 487 additions and 0 deletions

View File

@ -13,6 +13,9 @@ use yii\widgets\ActiveForm;
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'category_id')->dropDownList(
\yii\helpers\ArrayHelper::map(\common\models\SkillCategory::getAll(), 'id', 'name')
); ?>
<div class="form-group">
<?= Html::submitButton('Сохранить', ['class' => 'btn btn-success']) ?>

View File

@ -16,6 +16,7 @@ $this->params['breadcrumbs'][] = $this->title;
<p>
<?= Html::a('Добавить', ['create'], ['class' => 'btn btn-success']) ?>
<?= Html::a('Категории', ['/settings/skill-category'], ['class' => 'btn btn-success']) ?>
</p>
<?= GridView::widget([
@ -26,6 +27,12 @@ $this->params['breadcrumbs'][] = $this->title;
'id',
'name',
[
'attribute' => 'category_id',
'value' => function ($model) {
return $model->category ? $model->category->name : '-';
}
],
['class' => 'yii\grid\ActionColumn'],
],