index.php 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?php
  2. /**
  3. * Author: lf
  4. * Blog: https://blog.feehi.com
  5. * Email: job@feehi.com
  6. * Created at: 2016-03-21 14:14
  7. */
  8. /**
  9. * @var $this yii\web\View
  10. * @var $dataProvider yii\data\ActiveDataProvider
  11. * @var $searchModel backend\models\search\FriendlyLinkSearch
  12. */
  13. use backend\grid\DateColumn;
  14. use backend\grid\GridView;
  15. use backend\grid\SortColumn;
  16. use backend\grid\StatusColumn;
  17. use backend\widgets\Bar;
  18. use yii\helpers\Html;
  19. use backend\grid\CheckboxColumn;
  20. use backend\grid\ActionColumn;
  21. use common\libs\Constants;
  22. $this->title = "Friendly Links";
  23. $this->params['breadcrumbs'][] = Yii::t('app', 'Friendly Links');
  24. ?>
  25. <div class="row">
  26. <div class="col-sm-12">
  27. <div class="ibox">
  28. <?= $this->render('/widgets/_ibox-title') ?>
  29. <div class="ibox-content">
  30. <?= Bar::widget() ?>
  31. <?= GridView::widget([
  32. 'dataProvider' => $dataProvider,
  33. 'filterModel' => $searchModel,
  34. 'columns' => [
  35. [
  36. 'class' => CheckboxColumn::className(),
  37. ],
  38. [
  39. 'attribute' => 'name'
  40. ],
  41. [
  42. 'attribute' => 'url',
  43. 'format' => 'raw',
  44. 'value' => function ($model) {
  45. return Html::a($model->url, $model->url, ['target' => '_blank']);
  46. }
  47. ],
  48. [
  49. 'class' => SortColumn::className()
  50. ],
  51. [
  52. 'class' => StatusColumn::className(),
  53. 'filter' => Constants::getYesNoItems(),
  54. ],
  55. [
  56. 'class' => DateColumn::className(),
  57. 'attribute' => 'created_at',
  58. ],
  59. [
  60. 'class' => DateColumn::className(),
  61. 'attribute' => 'updated_at',
  62. ],
  63. [
  64. 'class' => ActionColumn::className(),
  65. ]
  66. ]
  67. ]) ?>
  68. </div>
  69. </div>
  70. </div>
  71. </div>