function Language::buildConfigurationForm
Same name in this branch
- 9 core/modules/language/src/Plugin/Condition/Language.php \Drupal\language\Plugin\Condition\Language::buildConfigurationForm()
Same name and namespace in other branches
- 8.9.x core/modules/language/src/Plugin/Condition/Language.php \Drupal\language\Plugin\Condition\Language::buildConfigurationForm()
- 10 core/modules/language/src/Plugin/Condition/Language.php \Drupal\language\Plugin\Condition\Language::buildConfigurationForm()
- 10 core/modules/ckeditor5/src/Plugin/CKEditor5Plugin/Language.php \Drupal\ckeditor5\Plugin\CKEditor5Plugin\Language::buildConfigurationForm()
- 11.x core/modules/language/src/Plugin/Condition/Language.php \Drupal\language\Plugin\Condition\Language::buildConfigurationForm()
- 11.x core/modules/ckeditor5/src/Plugin/CKEditor5Plugin/Language.php \Drupal\ckeditor5\Plugin\CKEditor5Plugin\Language::buildConfigurationForm()
Form constructor.
Plugin forms are embedded in other forms. In order to know where the plugin form is located in the parent form, #parents and #array_parents must be known, but these are not available during the initial build phase. In order to have these properties available when building the plugin form's elements, let this method return a form element that has a #process callback and build the rest of the form in the callback. By the time the callback is executed, the element's #parents and #array_parents properties will have been set by the form API. For more documentation on #parents and #array_parents, see \Drupal\Core\Render\Element\FormElement.
Parameters
array $form: An associative array containing the initial structure of the plugin form.
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form. Calling code should pass on a subform state created through \Drupal\Core\Form\SubformState::createForSubform().
Return value
array The form structure.
Overrides PluginFormInterface::buildConfigurationForm
See also
\Drupal\editor\Form\EditorImageDialog
editor_image_upload_settings_form()
File
-
core/
modules/ ckeditor5/ src/ Plugin/ CKEditor5Plugin/ Language.php, line 62
Class
- Language
- CKEditor 5 Language plugin.
Namespace
Drupal\ckeditor5\Plugin\CKEditor5PluginCode
public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
$predefined_languages = LanguageManager::getStandardLanguageList();
$form['language_list'] = [
'#title' => $this->t('Language list'),
'#title_display' => 'invisible',
'#type' => 'select',
'#options' => [
'un' => $this->t("United Nations' official languages"),
'all' => $this->t('All @count languages', [
'@count' => count($predefined_languages),
]),
],
'#default_value' => $this->configuration['language_list'],
'#description' => $this->t('The list of languages to show in the language dropdown. The basic list will only show the <a href=":url">six official languages of the UN</a>. The extended list will show all @count languages that are available in Drupal.', [
':url' => 'https://www.un.org/en/sections/about-un/official-languages',
'@count' => count($predefined_languages),
]),
];
return $form;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.