Пример #1
0
 public function getlimittype()
 {
     return $this->hasOne(AppCardsLimitType::className(), ['id' => 'id_limit_type']);
 }
Пример #2
0
<?php

use yii\helpers\Html;
use yii\helpers\ArrayHelper;
// use yii\grid\GridView;
use kartik\grid\GridView;
use yii\widgets\Pjax;
use app\models\AppSystemServices;
use app\models\AppCardsLimitType;
/* @var $this yii\web\View */
/* @var $searchModel app\models\AppCardsPurseSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Кошельки';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="app-cards-purse-index">
<?php 
$gridColumns = [['class' => 'kartik\\grid\\SerialColumn', 'contentOptions' => ['class' => 'kartik-sheet-style'], 'header' => '', 'headerOptions' => ['class' => 'kartik-sheet-style']], ['attribute' => 'id_service', 'value' => 'service.name', 'filterType' => GridView::FILTER_SELECT2, 'filter' => ArrayHelper::map(AppSystemServices::find()->all(), 'id', 'name'), 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true]], 'filterInputOptions' => ['placeholder' => 'Все услуги']], ['attribute' => 'id_card'], ['attribute' => 'limit'], ['attribute' => 'id_limit_type', 'value' => 'limittype.Description', 'filterType' => GridView::FILTER_SELECT2, 'filter' => ArrayHelper::map(AppCardsLimitType::find()->all(), 'id', 'Description'), 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true]], 'filterInputOptions' => ['placeholder' => 'Тип ...']], ['attribute' => 'individual'], ['attribute' => 'accaunt_sum'], ['class' => 'kartik\\grid\\ActionColumn', 'template' => '{view}{info}']];
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => $gridColumns, 'responsive' => true, 'hover' => true, 'pjax' => true, 'panel' => ['heading' => '<h3 class="panel-title"><i class="glyphicon glyphicon-folder-open"></i>' . '&nbsp;&nbsp' . Html::encode($this->title) . '</h3>', 'type' => 'primary', 'footer' => false], 'toolbar' => ['{export}', '{toggleData}']]);
?>
</div>