Skip to content

Kirby 4.5.0

$language->code()

Returns the language code/id.

$language->code(): string

Return type

string

Parent class

Kirby\Cms\Language

Example

<ul>
  <?php foreach($site->languages() as $language): ?>
  <li>
    <a href="<?= $language->url() ?>">
      <?= $language->code() ?>
    </a>
  </li>
  <?php endforeach ?>
</ul>