Hi, I want to know how can I add parameters to a function through the GET method in a rest api
This is my urlManager:
'urlManager' => [
'enablePrettyUrl' => true,
'enableStrictParsing' => true,
'showScriptName' => false,
'rules' => [
['class' => 'yii\rest\UrlRule',
'controller' => 'v1/institution',
'pluralize'=>false,
'extraPatterns' => [
'GET names' => 'names',
],
],
],
],
I’m calling it this way: api/v1/institution/names
and this is my function:
public function actionNames(){
//code return all names
}
It works ok… but what if I want to pass some params to the function ?
public function actionNames($param1,$param2){
//code
}
How can I do this ?
Thanks!