Blame view

app/modules/admin/views/menu/index.php 1.06 KB
bf807468   Alex Savenko   first commit
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
  <?
  use yii\helpers\Html;
  use yii\grid\GridView;
  
  $this->title = 'Меню';
  $this->params['breadcrumbs'][] = $this->title;
  ?>
  <h1>Меню</h1>
  <?= Html::a('Создать', ['/admin/menu/save'], ['class'=>'btn btn-success']) ?>
  <?= GridView::widget([
      'dataProvider' => $dataProvider,
      'columns' => [
  		[
  		'attribute' => 'id',
  		'value'=>'id',
  		'contentOptions'=>['style'=>'width: 70px;']
  		],
  		[
  		'attribute' => 'name',
  		'value'=>'name',
  		//'contentOptions'=>['style'=>'max-width: 300px;']
  		],		
          [
              'class'    => 'yii\grid\ActionColumn',
              'template' => '{update}&nbsp;&nbsp;{delete}',
  			        'buttons' => [
                          'update' => function ($url, $model) {
                          return Html::a('<span class="glyphicon glyphicon-pencil"></span>', ['/admin/menu/save','id'=>$model->id], 
                          [
                              'title' => "Редактировать",
                          ]);
                      }
                  ],
  			'contentOptions'=>['style'=>'width: 70px;']
          ],		
      ],
  ]) ?>