class LanguageConfigurationElement in Drupal 10
Same name and namespace in other branches
- 8 core/modules/language/tests/language_elements_test/src/Form/LanguageConfigurationElement.php \Drupal\language_elements_test\Form\LanguageConfigurationElement
- 9 core/modules/language/tests/language_elements_test/src/Form/LanguageConfigurationElement.php \Drupal\language_elements_test\Form\LanguageConfigurationElement
A form containing a language configuration element.
@internal
Hierarchy
- class \Drupal\Core\Form\FormBase implements ContainerInjectionInterface, FormInterface uses DependencySerializationTrait, LoggerChannelTrait, MessengerTrait, RedirectDestinationTrait, StringTranslationTrait
- class \Drupal\language_elements_test\Form\LanguageConfigurationElement
Expanded class hierarchy of LanguageConfigurationElement
1 string reference to 'LanguageConfigurationElement'
- language_elements_test.routing.yml in core/
modules/ language/ tests/ language_elements_test/ language_elements_test.routing.yml - core/modules/language/tests/language_elements_test/language_elements_test.routing.yml
File
- core/
modules/ language/ tests/ language_elements_test/ src/ Form/ LanguageConfigurationElement.php, line 14
Namespace
Drupal\language_elements_test\FormView source
class LanguageConfigurationElement extends FormBase {
/**
* {@inheritdoc}
*/
public function getFormId() {
return 'language_elements_configuration_element';
}
/**
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state) {
$conf = ContentLanguageSettings::loadByEntityTypeBundle('entity_test', 'some_bundle');
$form['lang_configuration'] = [
'#type' => 'language_configuration',
'#entity_information' => [
'entity_type' => 'entity_test',
'bundle' => 'some_bundle',
],
'#default_value' => $conf,
];
$form['submit'] = [
'#type' => 'submit',
'#value' => 'Save',
];
$form['#submit'][] = 'language_configuration_element_submit';
return $form;
}
/**
* {@inheritdoc}
*/
public function submitForm(array &$form, FormStateInterface $form_state) {
}
}