yii2 - yii framework - implement routing by request params -


is there way implement routing based on request params? example,

/v1/articles - action `serve_articles` /v1/articles?type=list - action `server_filtered_by_list` 

the simplest way form me

you can add (eg: index) action param need purpose

public function actionindex($type, $param2, $param3) {      ... code inclus call action in controller or      .... redirect or      .... render      return $this->render('index', [         'searchmodel' => $searchmodel,         'dataprovider' => $dataprovider,     ]); } 

Comments

Popular posts from this blog

matlab - error with cyclic autocorrelation function -

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

c# - What is a good .Net RefEdit control to use with ExcelDna? -