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

java - Static nested class instance -

c# - Bluetooth LE CanUpdate Characteristic property -

JavaScript - Replace variable from string in all occurrences -