Get data via url


(Nan Do9) #1

I have
/mycontroller/index1?modelSearch%5Bdate%5D=2019-09-26±+2019-09-27

I need to get the date value of the url using the get method, as I would do
I’ve tried the following but it doesn’t work for me
$request = Yii::$app->request;
$date= $request->get('date ');


(Softark) #2

Hi @nan_do9,

This will work, I hope.

$date = $request->get('modelSearch[date]');

(Nan Do9) #3

Thank you
I solved it this way
$date=Yii::$app->request->get(“modelSearch”)[“date”];