You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

72 lines
2.1 KiB

  1. <?php
  2. use yii\helpers\Html;
  3. use blobt\grid\GridView;
  4. //use yii\grid\GridView;
  5. /* @var $this yii\web\View */
  6. /* @var $searchModel common\models\CategorySearch */
  7. /* @var $dataProvider yii\data\ActiveDataProvider */
  8. $this->title = 'Categories';
  9. $this->params['breadcrumbs'][] = $this->title;
  10. ?>
  11. <div class="row">
  12. <div class="col-xs-12">
  13. <?= GridView::widget([
  14. 'dataProvider' => $dataProvider,
  15. 'filter' => $this->render("_search", ['model' => $searchModel]),
  16. 'batch' => [
  17. [
  18. "label" => "删除",
  19. "url" => "/category/deletes"
  20. ],
  21. [
  22. "label" => "其它操作",
  23. "url" => "/category/others"
  24. ],
  25. ],
  26. 'columns' => [
  27. [
  28. 'class' => 'blobt\grid\CheckboxColumn',
  29. 'width' => '2%',
  30. 'align' => 'center'
  31. ],
  32. [
  33. 'attribute' => 'id',
  34. 'width' => '5%',
  35. 'align' => 'center'
  36. ],
  37. [
  38. 'attribute' => 'created_at',
  39. 'width' => '7%',
  40. 'format' => 'date'
  41. ],
  42. [
  43. 'attribute' => 'cat_name',
  44. 'width' => '13%',
  45. ],
  46. [
  47. 'attribute' => 'icon',
  48. 'width' => '5%',
  49. ],
  50. [
  51. 'attribute' => 'icon_type',
  52. 'width' => '7%',
  53. 'showConstText' => true
  54. ],
  55. [
  56. 'attribute' => 'description',
  57. 'enableSorting' => false,
  58. 'format' => 'ntext',
  59. 'width' => '50%',
  60. ],
  61. [
  62. 'class' => 'blobt\grid\ActionColumn',
  63. 'align' => 'center',
  64. ],
  65. ],
  66. ]);
  67. ?>
  68. </div>
  69. </div>