skill category
This commit is contained in:
@ -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']) ?>
|
||||
|
@ -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'],
|
||||
],
|
||||
|
Reference in New Issue
Block a user