Blame view

backend/views/persone/index.php 1.78 KB
8ccb8fe5   Alexey Boroda   -Persones ready
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
  <?php
      
      use common\models\Persone;
      use common\models\PersoneSearch;
      use yii\data\ActiveDataProvider;
      use yii\helpers\Html;
      use yii\grid\GridView;
      use yii\web\View;
      use yiister\gentelella\widgets\Panel;
      
      /**
       * @var View               $this
       * @var ActiveDataProvider $dataProvider
       * @var PersoneSearch      $searchModel
       */
      
      $this->title = Yii::t('app', 'Persones');
      $this->params[ 'breadcrumbs' ][] = $this->title;
  ?>
  <div class="persone-index">
      
      <?php Panel::begin(
          [
              'header' => $this->title,
          ]
      ) ?>
      <?php // echo $this->render('_search', ['model' => $searchModel]); ?>
    
    <p>
        <?= Html::a(Yii::t('app', 'Create Persone'), [ 'create' ], [ 'class' => 'btn btn-success' ]) ?>
    </p>
      <?= GridView::widget(
          [
              'dataProvider' => $dataProvider,
              'filterModel'  => $searchModel,
              'columns'      => [
                  [ 'class' => 'yii\grid\SerialColumn' ],
                  
                  'lang.title',
                  [
                      'attribute' => 'image_id',
                      'value'     => function (Persone $model) {
                          if (!empty($model->image)) {
                              return Html::img(
                                  $model->image->getUrl(),
                                  [
                                      'width' => '500px',
                                  ]
                              );
                          } else {
                              return '';
                          }
                      },
                      'format' => 'html',
                  ],
                  
                  [ 'class' => 'yii\grid\ActionColumn' ],
              ],
          ]
      ); ?>
      <?php Panel::end() ?>
  </div>