It is necessary to make a link with 2 GET variables as a matter of fact:

createAbsoluteUrl(['site/about', 'id' => 1, 'post' => 2]) 

but it turns out some kind of beaverd, if so:

 createAbsoluteUrl(['site/about', 'id' => 1]) 

then everything works, how do you add a 2-variable variable

  • Show what you want, what beleberd is obtained, and what are the rules for link building. - Bookin
  • They say the same kind of changed absolute ... Not? rmcreative.ru/blog/post/yii2-izmenenija-v-rabote-s-url ..... in the end, you should write yii\helpers\Url::toRoute(['site/about', 'id'=>1,'post'=>'2']) ......... write all the code you use ..... for example <?php echo Yii::$app->urlManager->createAbsoluteUrl(['site/confirm', 'id' => 123,'code' => 333]) ;?> works for itself - Alexei Shimansky
  • code: Yii::$app->urlManager->createAbsoluteUrl(['site/about', 'username' => $this->username, 'verification_email' => $this->validation_email]) as a result we get: www.mysite.com/frontend/web/site/about?1%5Busername%5D=proba username is, but there is no second - Alexey

1 answer 1

I have a code

 <?= Yii::$app->urlManager->createAbsoluteUrl(['site/about', 'username' => 'aaa', 'verification_email' => 'xxx@bbb.cc']) ?> 

forms the correct string

 http://mysite/site/about?username=aaa&verification_email=xxx%40bbb.cc 

Check urlManager settings in the configuration.

Well, or what is the variable $this->validation_email