Skip to content

Kirby 3.8.4

$site->url()

Returns the Url

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

Parameters

Name Type Default
$language string 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') ?>