searchtitlenull.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <?php
  2. use app\models\news;
  3. use yii\helpers\Html;
  4. use yii\helpers\Url;
  5. use yii\grid\ActionColumn;
  6. use yii\widgets\ListView;
  7. use yii\widgets\ActiveForm;
  8. use yii\web\View;
  9. use yii\data\SqlDataProvider;
  10. /** @var yii\web\View $this */
  11. /** @var app\models\photoSearch $searchModel */
  12. /** @var yii\data\ActiveDataProvider $dataProvider */
  13. $page = trim(Yii::$app->request->get('page'));
  14. $this->title = 'Подписи фото отсутствуют';
  15. $this->params['breadcrumbs'][] = ['label' => 'Подписи фото', 'url' => ['phototitle']];
  16. $this->params['breadcrumbs'][] = $this->title;
  17. if ($this->beginCache('fd7fsdt8f_'.$page, ['duration' => 3600])) {
  18. $dataProvider = new \yii\data\ActiveDataProvider(
  19. [
  20. "query"=>\app\models\front\News::find()->andWhere(['>', 'dt_pub', Yii::$app->params['delPhotoE'] ])->andWhere([ 'or',"`photo_title`=''", ['or', '`photo_title`="\'\'"']])->orderBy(['dt_pub'=>SORT_DESC]),
  21. 'pagination' => [
  22. 'pageSize' => 30,
  23. ],
  24. ]
  25. );
  26. ?>
  27. <div class="content">
  28. <table class="table m-0 table-hover table-striped dataTable dtr-inline">
  29. <thead>
  30. <tr>
  31. <th>фото</th>
  32. <th>дата</th>
  33. <th>Статья</th>
  34. <th>Фото подпись</th>
  35. </tr>
  36. </thead>
  37. <?= ListView::widget([
  38. 'dataProvider' => $dataProvider,
  39. 'options' => [
  40. 'tag' => "div",
  41. 'class' => 'list-wrapper',
  42. 'id' => 'list-wrapper',
  43. ],
  44. "itemOptions"=>[
  45. "tag"=>"tr",'class' => '',
  46. ],
  47. "itemView" => "_itemtitles",
  48. "layout" => "{items}\n{pager}\n{summary}",
  49. 'pager' => [
  50. 'prevPageCssClass' => 'page-item',
  51. 'firstPageLabel' => 'Начало',
  52. 'lastPageLabel' => 'Конец',
  53. 'linkOptions' => [ 'class'=>'page-link'],
  54. 'pageCssClass' => 'page-item',
  55. 'disabledListItemSubTagOptions' => ['tag' => 'a', 'class' => 'page-link'],
  56. ]
  57. ]) ?>
  58. </table>
  59. </div>
  60. <?
  61. $this->endCache();
  62. }