5

I am newbie in Yii2. Please help me to achieve this. I want to know how to create absoluteurl in yii2. I have tried the code given below but I want something different.

echo Yii::$app->urlManager->createAbsoluteUrl(['site/confirm', 'id' => $user->id,'code' => $user->token,'&']);
output is http://car-rental.demoinja.com/site/confirm/69?code=275a9253dfc81efa47be4fdf1fc6a927&1=%26

But I want the url like this

http://car-rental.demoinja.com/site/confirm/?id=69&code=275a9253dfc81efa47be4fdf1fc6a927
Sangita Pal
  • 125
  • 1
  • 7

1 Answers1

3

No need to add '&' in createAbsoluteUrl function; so you need to use following function.

<?php echo Yii::$app->urlManager->createAbsoluteUrl(['site/confirm', 'id' => $user->id,'code' => $user->token]); ?>
GAMITG
  • 3,810
  • 7
  • 32
  • 51