yii2 send string to post route code example Example: print url in view yii2 $currentUrl = Yii::$app->request->url; //gives current URL