S
S
Sergey2015-04-15 21:49:41
Yii
Sergey, 2015-04-15 21:49:41

How to set infinite get variables in controller in yii2?

I have an action code that starts like this:

public function actionCompare($id1, $id2=false, $id3=false, $id4=false) {

I am tormented by doubts that this is not feng shui at all.
How to make an infinite number of id variables so that you can work with them further, as with an array?
How to declare them correctly?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
theded, 2015-04-15
@butteff

use Yii;
...
public function actionCompare()
{
    $get = Yii::$app->request->get(); // array of GET-params
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question