$currentUrl = \yii\helpers\Url::current(); echo $currentUrl; // outputs https://example.com/page?param1=value1¶m2=value2
$params = array('newParam' => 'newValue'); $currentUrl = \yii\helpers\Url::current($params); echo $currentUrl; // outputs https://example.com/page?param1=value1¶m2=value2&newParam=newValueThis helper is part of the `yii2-helper` package/library in the Yii framework.