index.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php
  2. use app\models\Page;
  3. use yii\helpers\Html;
  4. use yii\helpers\Url;
  5. use yii\grid\ActionColumn;
  6. use yii\grid\GridView;
  7. use yii\widgets\Pjax;
  8. /** @var yii\web\View $this */
  9. /** @var yii\data\ActiveDataProvider $dataProvider */
  10. $this->title = 'Pages';
  11. $this->params['breadcrumbs'][] = $this->title;
  12. ?>
  13. <div class="page-index">
  14. <h1><?= Html::encode($this->title) ?></h1>
  15. <p>
  16. <?= Html::a('Create Page', ['create'], ['class' => 'btn btn-success']) ?>
  17. </p>
  18. <?php Pjax::begin(); ?>
  19. <?= GridView::widget([
  20. 'dataProvider' => $dataProvider,
  21. 'columns' => [
  22. ['class' => 'yii\grid\SerialColumn'],
  23. 'id',
  24. 'status',
  25. 'menu',
  26. 'created',
  27. 'updated',
  28. //'create_user_id',
  29. //'update_user_id',
  30. //'parent_id',
  31. //'title',
  32. //'title_menu',
  33. //'title_seo',
  34. //'description_seo',
  35. //'keywords_seo',
  36. //'key',
  37. //'norder',
  38. //'path',
  39. //'content:ntext',
  40. //'index_controller',
  41. //'index_action',
  42. //'view_controller',
  43. //'view_action',
  44. //'index_params',
  45. //'lang',
  46. //'layout',
  47. [
  48. 'class' => ActionColumn::className(),
  49. 'urlCreator' => function ($action, Page $model, $key, $index, $column) {
  50. return Url::toRoute([$action, 'id' => $model->id]);
  51. }
  52. ],
  53. ],
  54. ]); ?>
  55. <?php Pjax::end(); ?>
  56. </div>