$site->url([$lang=false])

Returns the base URL for the site

  • $lang (string)
    Optional, only multi-language sites
  • return (string)

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') ?>

Is something missing or incorrect? Edit this page on Github…