canonical() public static method
Returns the canonical URL of the currently requested page.
The canonical URL is constructed using the current controller's yii\web\Controller::$route and yii\web\Controller::$actionParams. You may use the following code in the layout view to add a link tag about canonical URL:
$this->registerLinkTag(['rel' => 'canonical', 'href' => Url::canonical()]);
public static string canonical ( ) | ||
---|---|---|
return | string |
The canonical URL of the currently requested page |
Please login to continue.