You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.8 KiB

7 years ago
<?php
use core\entities\post\PostCategory;
3 years ago
use core\entities\post\PostType;
use core\forms\post\search\PostCategorySearch;
7 years ago
use yii\grid\ActionColumn;
use yii\helpers\Html;
use yii\grid\GridView;
/* @var $this yii\web\View */
3 years ago
/* @var $searchModel PostCategorySearch */
7 years ago
/* @var $dataProvider yii\data\ActiveDataProvider */
3 years ago
/* @var $type PostType */
7 years ago
$title = Yii::t('post', 'Categories');
$this->title = $type->plural .' > '. $title;
$this->params['breadcrumbs'][] = $title;
?>
<div class="user-index">
<p>
<?= Html::a(Yii::t('post', 'Create Category'), ['create', 'tid' => $type->id], ['class' => 'btn btn-success']) ?>
</p>
<div class="box">
<div class="box-body">
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
[
'attribute' => 'sort',
'options' => ['style' => 'width: 100px;'],
],
[
'attribute' => 'name',
'value' => function (PostCategory $model) {
return Html::a(Html::encode($model->name), ['view', 'id' => $model->id]);
},
'format' => 'raw',
],
[
'attribute' => 'slug',
],
[
'attribute' => 'title',
],
[
'class' => ActionColumn::class,
'options' => ['style' => 'width: 100px;'],
'contentOptions' => ['class' => 'text-center'],
],
],
]); ?>
</div>
</div>
</div>