registerJsFile( '@web/js/autocomplete/jquery.autocomplete.min.js', ['position'=>View::POS_END, 'defer' => 'defer'], 'autocomplete' ); $this->params['breadcrumbs'] = [ [ "text"=>"НОВОСТИ", "url"=>"/news" ] ]; if($topic instanceof NewsTopic){ $this->params['breadcrumbs'][] = [ "text"=>$topic->title, "url"=>$topic->url ]; } $dateRange = \Yii::$app->request->get('daterange'); $ssearch = \Yii::$app->request->get('q'); $tag = \Yii::$app->request->get('tag',null); $story = \Yii::$app->request->get('story',null); if( !is_null($story) ){ $storys = Story::findOne(['id'=>$story]); } if( !is_null($tag) ){ $tags = Tags::findOne(['id'=>$tag]); } $sstring = !isset($tags)?'':'по тэгу:'.$tags->title; $sstring .= !isset($storys)?'':' по сюжету:'.$storys->title; $sstring .= ' '.$ssearch; if(!is_null($dateRange) && $dateRange!=""){ $dateRange = explode(" — ",$dateRange); $dtb = date("Y-m-d",strtotime($dateRange[0])); $dte = isset($dateRange[1])?date("Y-m-d",strtotime($dateRange[1])):date("Y-m-d",strtotime($dateRange[0])); } $page = \Yii::$app->request->get('page'); $addtpage = $page?". Страница ($page)":''; Yii::$app->og->title = "Страница поиска".$addtpage.' - '.$sstring; Yii::$app->og->description = "Поиск статей по сайту amic.ru".$addtpage.' - '.$sstring; Yii::$app->og->noindex = 'Y'; ?>
Поиск по запросу:
" name="index"> ">
cache->getOrSet("search_rubrics-{$topic->id}",function () use($topic){ 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]), //"topic_id"=>$topic->id next lavel maybe "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); ?>
render("archive/filters")?>
count(); if( $cnt > 500*30 ) $cnt = 500*30; echo \yii\widgets\ListView::widget([ "dataProvider" => new \yii\data\ActiveDataProvider([ "query"=>$news_query, "totalCount"=>$cnt, "pagination" =>[ "pageSize"=>30 ], ]), 'options' => [ 'tag' => "ul", 'class' => 'list-wrapper', 'id' => 'list-wrapper', ], "itemOptions"=>[ "tag"=>"li" ], "itemView" => "archive/_archive_item", "layout" => "{items}{pager}" ]); } ?>
registerJs($Js, View::POS_READY); ?>