Reference

$languages

A collection of all defined site languages

Details

To use the methods of the $languages class, you need a $languages object, which you get can like this:

$languages = $kirby->languages();

With the object in place, you can now use it like this:

Examples

Find a language by code

$language = $languages->find('de');

Get the number of languages

$numberOfLanguage = $languages->count();

Sort languages by name

$sortedLanguages = $languages->sortBy('name', 'desc');