lang() table()
Show a language code with the flag of its default country.
table()->lang($name, $data = [], $extra = [])Options
| Option | Meaning |
|---|---|
(common options) | The common column options. |
Example
| Title | Language |
|---|---|
| Welcome | EN |
| Ласкаво просимо | UK |
| Willkommen | DE |
Code
$rows = [
1 => ['id' => 1, 'title' => 'Welcome', 'locale' => 'en'],
2 => ['id' => 2, 'title' => 'Ласкаво просимо', 'locale' => 'uk'],
3 => ['id' => 3, 'title' => 'Willkommen', 'locale' => 'de'],
];
return table($rows, ['no_pages' => 1])
->text('title')
->lang('locale', [], ['desc' => 'Language']);Notes
- The country comes from the
lang_def_countrydata handler; the flags are thebfh-flag-*sprites of thebfh-selectasset.
See also: form/language_box, html/icon