index.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. use yii\helpers\Html;
  3. use yii\grid\GridView;
  4. /* @var $this yii\web\View */
  5. /* @var $searchModel app\models\HelpVideoSearch */
  6. /* @var $dataProvider yii\data\ActiveDataProvider */
  7. $this->title = Yii::t('app', 'Help Videos');
  8. $this->params['breadcrumbs'][] = $this->title;
  9. ?>
  10. <div class="help-video-index">
  11. <h1><?= Html::encode($this->title) ?></h1>
  12. <?php // echo $this->render('_search', ['model' => $searchModel]); ?>
  13. <p>
  14. <?= Html::a(Yii::t('app', 'Create Help Video'), ['create'], ['class' => 'btn btn-success']) ?>
  15. </p>
  16. <?= GridView::widget([
  17. 'dataProvider' => $dataProvider,
  18. 'filterModel' => $searchModel,
  19. 'columns' => [
  20. ['class' => 'yii\grid\SerialColumn'],
  21. //'id',
  22. [
  23. 'attribute' => 'link',
  24. 'format' => 'raw',
  25. 'value' => function($model){
  26. return Html::tag('iframe',$model->link,['src' => $model->link,'frameborder' => "0",'allowfullscreen']);
  27. }
  28. ],
  29. [
  30. 'attribute'=>'cat_id',
  31. 'value' => 'cat.title'
  32. ],
  33. //'created_at',
  34. ['class' => 'yii\grid\ActionColumn'],
  35. ],
  36. ]); ?>
  37. </div>