index.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. use yii\helpers\Html;
  3. use yii\grid\GridView;
  4. /* @var $this yii\web\View */
  5. /* @var $searchModel backend\models\search\CircleSearch */
  6. /* @var $dataProvider yii\data\ActiveDataProvider */
  7. $this->title = Yii::t('common', 'Circles');
  8. $this->params['breadcrumbs'][] = $this->title;
  9. ?>
  10. <?php $this->beginBlock('content-header') ?>
  11. <?= $this->title . ' ' . Html::a(Yii::t('common', 'Create Circle'), ['create'], ['class' => 'btn btn-success']) ?>
  12. <?php $this->endBlock() ?>
  13. <?php // echo $this->render('_search', ['model' => $searchModel]); ?>
  14. <div class="box box-success">
  15. <div class="box-body">
  16. <?= GridView::widget([
  17. 'dataProvider' => $dataProvider,
  18. 'filterModel' => $searchModel,
  19. 'columns' => [
  20. 'cat_id:circleCat',
  21. 'title',
  22. 'type:circleType',
  23. 'url',
  24. [
  25. 'attribute' => 'avatar',
  26. 'format' => ['image', ['style' => 'height: 40px; width: 40px;border-radius: 50%;border: none;']],
  27. 'contentOptions' => ['class' => 'media-content']
  28. ],
  29. [
  30. 'attribute' => 'qrcode',
  31. 'format' => ['image', ['style' => 'height: 40px; width: 40px;border-radius: 50%;border: none;']],
  32. 'contentOptions' => ['class' => 'media-content']
  33. ],
  34. [
  35. 'class' => 'backend\widgets\grid\PositionColumn',
  36. 'attribute' => 'sort'
  37. ],
  38. [
  39. 'class' => 'backend\widgets\grid\SwitcherColumn',
  40. 'attribute' => 'status'
  41. ],
  42. [
  43. 'class' => 'common\helpers\DiyActionColumn',
  44. 'template' => '{update} {delete}',
  45. ]
  46. ],
  47. ]); ?>
  48. </div>
  49. </div>