Blame view

frontend/views/accounts/vacancy.php 1.59 KB
588209fc   Yarik   test
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
  <?php
      /**
       * @var VacancySearch         $searchModel
       * @var ActiveDataProvider $dataProvider
       */
      use common\models\VacancySearch;
      use yii\data\ActiveDataProvider;
      use yii\grid\ActionColumn;
      use yii\grid\GridView;
      use yii\helpers\Html;
  
      $this->title = 'Вакансии';
      $this->params[ 'breadcrumbs' ][] = $this->title;
  ?>
  <h1><?= $this->title ?></h1>
  <p>
      <?= Html::a(Yii::t('app', 'Добавить'), [ 'vacancy-create' ], [ 'class' => 'btn btn-success' ]) ?>
  </p>
  <?= GridView::widget([
      'dataProvider' => $dataProvider,
      'filterModel'  => $searchModel,
      'columns' => [
          [
              'attribute' => 'vacancy_id',
              'label' => 'ID',
          ],
          'name',
          'view_count',
          [
              'class' => ActionColumn::className(),
              'buttons' => [
                  'update' => function($url, $model, $key) {
                      return Html::a('Update', ['vacancy-update', 'id' => $model->vacancy_id]);
                  },
                  'delete' => function($url, $model, $key) {
                      return Html::a('Delete', ['vacancy-delete', 'id' => $model->vacancy_id], [
                          'title' => 'Удалить',
                          'aria-label' => 'Удалить',
                          'data-confirm' => 'Вы уверены, что хотите удалить этот элемент?',
                          'data-method' => 'post',
                          'data-pjax' => '0',
                      ]);
                  },
              ],
              'template' => '{update} {delete}'
          ]
      ]
  ]); ?>