Skip to content

$site->url()

Returns the Url

$site->url(string|null $language = null): string

Parameters

Name Type Default
$language string|null null

Return type

string

Parent class

Kirby\Cms\Site

If a $lang parameter is specified (multi-language site only), the specific language URL is returned.

Example

Fetching the base URL for the site

<?= $site->url() ?>

Fetching the base URL for a language

<?= $site->url('en') ?>