single: Forms; Fields; language
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 |
These options inherit from the choice</reference/forms/types/choice>
type:
These options inherit from the field</reference/forms/types/field>
type: