Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function actionSearch($q){
- if(strstr($q,"tag:")){
- $tag = explode(":",$q)[1];
- }
- $tags = null;
- $models = \common\models\Pages::find()
- ->where(['like','title',$q])
- ->orWhere(['like','description',$q])
- ->all();
- if(isset($tag)){
- $tags = \common\models\eProductsTags::find()->where(['tag' => $tag])->all();
- }
- return $this->render('search',['models'=>$models,'q'=>$q,'tags'=>$tags]);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement