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
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]); ?>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With