$language
The $language
object represents a single language in a multi-language Kirby setup. You can, for example, use the methods of this class to get the name or locale of a language, check for the default language, get translation strings and many more things.
-
new Language()
-
$language->baseUrl()
-
$language->clone()
-
$language->code()
-
$language->direction()
-
$language->exists()
-
$language->hardcopy()
-
$language->id()
-
$language->isDefault()
-
$language->kirby()
-
Language::loadRules()
-
$language->locale()
-
$language->name()
-
$language->path()
-
$language->pattern()
-
$language->root()
-
$language->router()
-
$language->site()
-
$language->slugs()
-
$language->smartypants()
-
$language->toArray()
-
$language->translations()
-
$language->url()
Details
To have access to the methods of the $language
object, you need to get a language object first:
Default language
The current language
Any particular language
Examples
With the object in place, you can use it like this: