params['breadcrumbs'] = [ [ "text"=>"НОВОСТИ", "url"=>"/news" ] ]; $page = \Yii::$app->request->get('page'); $addpage = $page?'?page='.$page:''; $addtpage = $page?". Страница ($page)":''; if($topic instanceof NewsTopic || $topic instanceof Story || $topic instanceof Tags){ $this->params['breadcrumbs'][] = [ "text"=>$topic->title, "url"=>$topic->url ]; $addtitle = ( $topic instanceof Tags )?'Тег: ':''; // $addtitle = ( $topic instanceof Story )?'Сюэет: ':''; открыть если будут дубли Yii::$app->og->canonical = $topic->getUrl(true); $this->title = $topic->title; Yii::$app->og->title = $addtitle.$topic->title.$addtpage; Yii::$app->og->description = $topic->description.$addtpage?:'Лента новостей - '.Yii::$app->og->description.$addtpage; Yii::$app->og->og_title = str_replace( '"',""",$topic->title); Yii::$app->og->og_description = str_replace( '"', """, Yii::$app->og->description ); }else{ Yii::$app->og->title = 'Лента новостей - '.Yii::$app->og->title.$addtpage; Yii::$app->og->description = 'Лента новостей - '.Yii::$app->og->description.$addtpage; Yii::$app->og->og_title = str_replace( '"',""", Yii::$app->og->title ); Yii::$app->og->og_description = str_replace( '"',""", Yii::$app->og->description ); Yii::$app->og->canonical = Url::base('https')."/news".$addpage; } //$pages->setPageSize(0,true); ?>