Answer the question
In order to leave comments, you need to log in
How to automatically generate a path?
How can it be implemented so that when switching to the controller without specifying any parameters, a certain path is formed!
For example, when the user enters into the command line http://user/index?id=
or http://user/index?
the path was automatically formed http://user/index?id=mainpage&user=1
. By what means is this implemented?
Answer the question
In order to leave comments, you need to log in
Does the user need a path in the address bar?
Default values in Yii2 are very easy to implement
public function actionIndex($id="mainpage", $user=1){
// ...
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question