$site->urlForLanguage()
Returns the translated url
$site->urlForLanguage(string|null $languageCode = null, array|null $options = null): string
Parameters
| Name | Type | Default |
|---|---|---|
| $languageCode | stringornull |
null
|
| $options | arrayornull |
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 a language
<?= $site->urlForLanguage('en') ?>