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.

57 lines
1.9 KiB

6 years ago
<?php
use common\modules\banners\entities\BannerPlace;
use common\modules\banners\helpers\BannerHelper;
use yii\grid\ActionColumn;
use yii\helpers\Html;
use yii\grid\GridView;
/* @var $this yii\web\View */
/* @var $searchModel \common\modules\banners\forms\search\BannerSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('banners', 'Places');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="place-index">
<p>
<?= Html::a(Yii::t('banners','Create Place'), ['create'], ['class' => 'btn btn-success']) ?>
</p>
<div class="box">
<div class="box-body">
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
[
'attribute' => 'title',
'value' => function (BannerPlace $model) {
return Html::a(Html::encode($model->title), ['view', 'id' => $model->id]);
},
'format' => 'raw',
],
'width',
'height',
[
'attribute' => 'active',
'filter' => BannerHelper::statusList(),
'format' => 'raw',
'value' => function(BannerPlace $place) {
return BannerHelper::statusLabel($place->active);
},
'options' => ['style' => 'width: 150px;'],
'contentOptions' => ['class' => 'text-center'],
],
[
'class' => ActionColumn::class,
'options' => ['style' => 'width: 100px;'],
'contentOptions' => ['class' => 'text-center'],
],
],
]); ?>
</div>
</div>
</div>