<?php

use app\models\ReportTopic;
use yii\helpers\Html;
use yii\helpers\Url;
use yii\grid\ActionColumn;
use yii\grid\GridView;
use yii\widgets\ListView;

/** @var yii\web\View $this */
/** @var yii\data\ActiveDataProvider $dataProvider */

$this->title = 'Старые фоторепортажи';

$this->params['breadcrumbs'] = [];
$this->params['breadcrumbs'][] =
    [
       "text"=>"Фото репортажи",
       "url"=>"/photo"
	];

	$page = \Yii::$app->request->get('page');
	$addtpage = $page?" - страница $page":'';

	Yii::$app->og->title = "Архив фоторепортажей amic.ru".$addtpage;
	Yii::$app->og->description = "Архив фоторепортажей amic.ru, велся как отдельный раздел до 2022 года.".$addtpage;

$dataProvider->getPagination()->pageSize = 50;

?>
<div class="archive">
    <div class="row">
        <div class="col-md-10 mx-4">
            <div class="news-list">

                <?=$this->render("/layouts/breadcrumbs")?>
                <?php
				$request = Yii::$app->request;
				$ppage = $request->get('page');
				$ppage = ($ppage)?'-'.$ppage:'';
                echo Yii::$app->cache->getOrSet("archive_photo-{$ppage}",function () use($dataProvider){
                    return ListView::widget([
                        "dataProvider" => $dataProvider,
                        'options' => [
                            'tag' => "ul",
                            'class' => 'list-wrapper',
                            'id' => 'list-wrapper',
                        ],
                        "itemOptions"=>[
                            "tag"=>"li"
                        ],
                        "itemView" => "_archive_item",
                        "layout" => "{items}{pager}",

                    ]);
                },1);
                ?>

            </div>
        </div>
	</div>
</div>
