helpers\BaseUrl canonical()

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

doc_Yii
2016-10-30 17:05:32
Comments
Leave a Comment

Please login to continue.