Skip to content

Latest commit

 

History

History
63 lines (44 loc) · 2.88 KB

language.rst

File metadata and controls

63 lines (44 loc) · 2.88 KB

single: Forms; Fields; language

language Field Type

The language type is a subset of the ChoiceType that allows the user to select from a large list of languages. As an added bonus, the language names are displayed in the language of the user.

The "value" for each locale is either the two letter ISO639-1 language code (e.g. fr).

Note

The locale of your user is guessed using Locale::getDefault()

Unlike the choice type, you don't need to specify a choices or choice_list option as the field type automatically uses a large list of languages. You can specify either of these options manually, but then you should just use the choice type directly.

Rendered as can be various tags (see forms-reference-choice-tags)
Inherited options
Parent type choice</reference/forms/types/choice>
Class Symfony\\Component\\Form\\Extension\\Core\\Type\\LanguageType

Inherited Options

These options inherit from the choice</reference/forms/types/choice> type:

These options inherit from the field</reference/forms/types/field> type: