request->get('page'); $ppage = ($page)?'-'.$page:''; $addtpage = $page?". Страница ($page)":''; $this->params['breadcrumbs'] = [ [ "text"=>"СТАТЬИ", "url"=>"/articles" ] ]; $this->title = "Лента статей: amic.ru"; Yii::$app->og->title = $this->title.$addtpage; Yii::$app->og->description ='Лента Статей - '.Yii::$app->og->description.$addtpage; Yii::$app->og->og_title = str_replace( '"',""", $this->title ); Yii::$app->og->og_description = str_replace( '"',""",Yii::$app->og->description); $url = '/articles'; Yii::$app->og->canonical = $url; Yii::$app->og->og_type = "website"; jsonLD::addAmicORG(); $i = 1; foreach($this->params['breadcrumbs'] as $el){ jsonLD::addBreadcrumb($i, $el['url'], $el['text']); $i++; } ?>
cache->getOrSet("archive_rubrics-articles",function (){ return \yii\widgets\ListView::widget([ "dataProvider" => new \yii\data\ActiveDataProvider([ "query"=>NewsTopic::find()->andWhere(["show"=>"Y","active"=>1, "topic_id"=>null])->orderBy(["order"=>SORT_ASC]), "pagination" =>[ "pageSize"=>0 ], ]), 'options' => [ 'tag' => "ul", 'class' => 'list-wrapper', 'id' => 'list-wrapper', ], "itemOptions"=>[ "tag"=>"li" ], "itemView" => function($model) { if( $model->url == '----'){ $ret = \yii\helpers\Html::tag('div','',['class' => ['hr']]); $ret .= \yii\helpers\Html::tag('span',$model->title,['class' => ['header']]); return $ret; } return \yii\helpers\Html::a($model->title,["news/{$model->url}"],[]); }, "layout" => "{items}" ]); },600); ?>
render("/layouts/breadcrumbs")?> cache->getOrSet("articles_news-".$ppage,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}" ]); },600); ?>