$site->url()
Returns the Url
$site->url(string|null $language = null): string
Parameters
Name | Type | Default |
---|---|---|
$language | string ornull |
null
|
Return type
string
This method modifies the existing $site
object it is applied to and returns it again.
Parent class
If a $lang parameter is specified (multi-language site only), the specific language URL is returned.
Examples
Fetching the base URL for the site
<?= $site->url() ?>
Fetching the base URL for a language
<?= $site->url('en') ?>