12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- <?php
- /**
- * @var $topic NewsTopic | NULL
- * @var $this \yii\web\View
- * @var $news_query \yii\db\ActiveQuery
- */
- use app\models\base\NewsTopic;
- $this->params['breadcrumbs'] = [
- [
- "text"=>"НОВОСТИ",
- "url"=>"/news"
- ]
- ];
- if($topic instanceof NewsTopic){
- $this->params['breadcrumbs'][] =
- [
- "text"=>$topic->title,
- "url"=>$topic->url
- ];
- }
- ?>
- <div class="archive">
- <div class="row">
- <div class="col-md-3">
- <div class="topics-list">
- <div class="topics-continer">
- <?php
- echo Yii::$app->cache->getOrSet("archive_rubrics-{$topic->id}",function () use($topic){
- return \yii\widgets\ListView::widget([
- "dataProvider" => new \yii\data\ActiveDataProvider([
- "query"=>NewsTopic::find()->andWhere(["show"=>"Y","active"=>1])->orderBy(["order"=>SORT_DESC]),
- "pagination" =>[
- "pageSize"=>0
- ],
- ]),
- 'options' => [
- 'tag' => "ul",
- 'class' => 'list-wrapper',
- 'id' => 'list-wrapper',
- ],
- "itemOptions"=>[
- "tag"=>"li"
- ],
- "itemView" => function($model) use($topic) {return \yii\helpers\Html::a($model->title,["news/{$model->url}"],['class'=>$model->id==$topic->id?"active":""]);},
- "layout" => "{items}"
- ]);
- },600);
- ?>
- </div>
- </div>
- </div>
- <div class="col-md-9">
- <div class="news-list">
- <?=$this->render("/layouts/breadcrumbs")?>
- <?=$this->render("archive/filters")?>
- <?php
- echo Yii::$app->cache->getOrSet("archive_news-{$topic->id}",function () use($news_query){
- return \yii\widgets\ListView::widget([
- "dataProvider" => new \yii\data\ActiveDataProvider([
- "query"=>$news_query,
- "pagination" =>[
- "pageSize"=>20
- ],
- ]),
- 'options' => [
- 'tag' => "ul",
- 'class' => 'list-wrapper',
- 'id' => 'list-wrapper',
- ],
- "itemOptions"=>[
- "tag"=>"li"
- ],
- "itemView" => "archive/_archive_item",
- "layout" => "{items}{pager}"
- ]);
- },1);
- ?>
- </div>
- </div>
- </div>
- </div>
|