index.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. use yii\helpers\Html;
  3. use yii\grid\GridView;
  4. use yii\widgets\Pjax;
  5. /* @var $this yii\web\View */
  6. /* @var $searchModel app\models\LotSearch */
  7. /* @var $dataProvider yii\data\ActiveDataProvider */
  8. $this->title = Yii::t('app', 'Messages ID');
  9. $this->params['breadcrumbs'][] = $this->title;
  10. ?>
  11. <div class="panel panel-primary">
  12. <div class="panel-heading"><span class="glyphicon glyphicon-envelope"></span><strong> <?= Html::encode($this->title) ?></strong></div>
  13. <div class="panel-body">
  14. <div class="messages-index">
  15. <?= $this->render('_alert.php') ?>
  16. <?php Pjax::begin(); ?>
  17. <?= GridView::widget([
  18. 'dataProvider' => $dataProvider,
  19. 'columns' => [
  20. [
  21. 'attribute' => 'date',
  22. 'header' => Yii::t('app','Dates ID'),
  23. 'format' => 'datetime',
  24. ],
  25. [
  26. 'attribute' => 'notes',
  27. 'header' => Yii::t('app','Notes ID'),
  28. ],
  29. [
  30. 'class' => 'yii\grid\ActionColumn',
  31. 'template' => '{view}{delete}',
  32. 'buttons' => [
  33. 'view' => function($url, $model, $key){
  34. return Html::a('<i class="glyphicon glyphicon-eye-open"></i>', ['/messages/view', 'id' => $model['id']]);
  35. },
  36. 'delete' => function($url, $model, $key){
  37. return Html::a('<i class="glyphicon glyphicon-trash"></i>', ['/messages/delete', 'id' => $model['id']], [
  38. 'data' => [
  39. 'method' => 'post',
  40. ]
  41. ]);
  42. }
  43. ]
  44. ],
  45. ],
  46. ]); ?>
  47. <?php Pjax::end(); ?>
  48. </div>
  49. </div>
  50. </div>