Blame view

frontend/views/accounts/portfolio.php 2.14 KB
51e0a262   Yarik   test
1
  <?php
588209fc   Yarik   test
2
3
4
5
6
7
8
9
10
      /**
       * @var PortfolioSearch    $searchModel
       * @var ActiveDataProvider $dataProvider
       */
      use common\models\PortfolioSearch;
      use yii\data\ActiveDataProvider;
      use yii\grid\ActionColumn;
      use yii\grid\GridView;
      use yii\helpers\Html;
51e0a262   Yarik   test
11
  
588209fc   Yarik   test
12
13
      $this->title = 'Портфолио';
      $this->params[ 'breadcrumbs' ][] = $this->title;
51e0a262   Yarik   test
14
  ?>
fd7caf21   Виталий   tokar commit
15
16
  <div class="login-left-column-title"><?= $this->title ?></div>
  <div class="admin-all-pages-add">
989c83b0   Yarik   test
17
      <?= Html::a(Yii::t('app', 'Добавить'), [ 'portfolio-create' ], [ 'class' => 'btn btn-success' ]) ?>
fd7caf21   Виталий   tokar commit
18
  </div>
588209fc   Yarik   test
19
  <?= GridView::widget([
fd7caf21   Виталий   tokar commit
20
      'options' => ['class'=>'style admin-all-pages-wr'],
588209fc   Yarik   test
21
22
23
24
      'dataProvider' => $dataProvider,
      'filterModel'  => $searchModel,
      'columns'      => [
          [
989c83b0   Yarik   test
25
              'attribute' => 'portfolio_id',
588209fc   Yarik   test
26
27
28
              'label'     => 'ID',
          ],
          'name',
989c83b0   Yarik   test
29
          'date_add',
588209fc   Yarik   test
30
31
          'view_count',
          [
989c83b0   Yarik   test
32
33
34
              'attribute' => 'specializationString',
          ],
          [
588209fc   Yarik   test
35
36
37
              'class'    => ActionColumn::className(),
              'buttons'  => [
                  'update' => function($url, $model, $key) {
8e5fa1e8   Виталий   tokar commit
38
                      return Html::a('<img src="/images/ico_pencil.png" alt="">', [
989c83b0   Yarik   test
39
40
                          'portfolio-update',
                          'id' => $model->portfolio_id,
8e5fa1e8   Виталий   tokar commit
41
42
                      ],[
                          'title'        => 'Редактировать',
588209fc   Yarik   test
43
44
45
                      ]);
                  },
                  'delete' => function($url, $model, $key) {
8e5fa1e8   Виталий   tokar commit
46
                      return Html::a('<img src="/images/delete-ico.png" alt="">', [
989c83b0   Yarik   test
47
48
                          'portfolio-delete',
                          'id' => $model->portfolio_id,
588209fc   Yarik   test
49
50
51
52
53
54
55
56
57
58
59
60
61
                      ], [
                          'title'        => 'Удалить',
                          'aria-label'   => 'Удалить',
                          'data-confirm' => 'Вы уверены, что хотите удалить этот элемент?',
                          'data-method'  => 'post',
                          'data-pjax'    => '0',
                      ]);
                  },
              ],
              'template' => '{update} {delete}',
          ],
      ],
  ]); ?>