use yeesoft\post\models\Category; use yii\helpers\Url; use yii\widgets\Pjax; /* @var $this yii\web\View */ /* @var $searchModel yeesoft\post\search\CategorySearch */ /* @var $dataProvider yii\data\ActiveDataProvider */ $this->title = Yii::t('yee/media', 'Categories'); $this->params['breadcrumbs'][] = ['label' => Yii::t('yee/post', 'Posts'), 'url' => ['/post/default/index']]; $this->params['breadcrumbs'][] = $this->title; ?> <div class="post-category-index"> <div class="row"> <div class="col-sm-12"> <h3 class="lte-hide-title page-title"><?php echo Html::encode($this->title); ?> </h3> <?php echo Html::a(Yii::t('yee', 'Add New'), ['/post/category/create'], ['class' => 'btn btn-sm btn-primary']); ?> </div> </div> <div class="panel panel-default"> <div class="panel-body"> <div class="row"> <div class="col-sm-12 text-right"> <?php echo GridPageSize::widget(['pjaxId' => 'post-category-grid-pjax']);
</div> <div class="col-sm-6 text-right"> <?php echo GridPageSize::widget(['pjaxId' => 'trip-grid-pjax']); ?> </div> </div> <?php Pjax::begin(['id' => 'trip-grid-pjax']); ?> <?php echo GridView::widget(['id' => 'trip-grid', 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'bulkActionOptions' => ['gridId' => 'trip-grid', 'actions' => [Url::to(['bulk-delete']) => Yii::t('yee', 'Delete')]], 'columns' => [['class' => 'yeesoft\\grid\\CheckboxColumn', 'options' => ['style' => 'width:10px']], ['attribute' => 'vehicle_model', 'class' => 'yeesoft\\grid\\columns\\TitleActionColumn', 'controller' => '/trip/default', 'title' => function (Trip $model) { $vehicle = $model->getVehicles()[$model->vehicle] . ' > ' . Html::encode($model->vehicle_model); return Html::a($vehicle, ['update', 'id' => $model->id], ['data-pjax' => 0]); }, 'buttonsTemplate' => '{update} {delete}', 'options' => ['style' => 'width:260px']], 'city_from', 'city_to', ['attribute' => 'created_by', 'filter' => User::getUsersList(), 'value' => function (Trip $model) { return Html::a(Html::encode($model->author->username), ['/user/default/update', 'id' => $model->created_by], ['data-pjax' => 0]); }, 'format' => 'raw', 'visible' => User::hasPermission('viewUsers')], ['class' => 'yeesoft\\grid\\columns\\StatusColumn', 'attribute' => 'type', 'optionsArray' => Trip::getTypeOptionsList(), 'options' => ['style' => 'width:60px']], ['class' => 'yeesoft\\grid\\columns\\StatusColumn', 'attribute' => 'status', 'optionsArray' => Trip::getStatusOptionsList(), 'options' => ['style' => 'width:60px']]]]); ?> <?php Pjax::end(); ?> </div> </div> </div>