function ConfigSingleExportForm::updateExport
Same name in other branches
- 8.9.x core/modules/config/src/Form/ConfigSingleExportForm.php \Drupal\config\Form\ConfigSingleExportForm::updateExport()
- 10 core/modules/config/src/Form/ConfigSingleExportForm.php \Drupal\config\Form\ConfigSingleExportForm::updateExport()
- 11.x core/modules/config/src/Form/ConfigSingleExportForm.php \Drupal\config\Form\ConfigSingleExportForm::updateExport()
Handles switching the export textarea.
1 call to ConfigSingleExportForm::updateExport()
- ConfigSingleExportForm::buildForm in core/
modules/ config/ src/ Form/ ConfigSingleExportForm.php - Form constructor.
File
-
core/
modules/ config/ src/ Form/ ConfigSingleExportForm.php, line 146
Class
- ConfigSingleExportForm
- Provides a form for exporting a single configuration file.
Namespace
Drupal\config\FormCode
public function updateExport($form, FormStateInterface $form_state) {
// Determine the full config name for the selected config entity.
if ($form_state->getValue('config_type') !== 'system.simple') {
$definition = $this->entityTypeManager
->getDefinition($form_state->getValue('config_type'));
$name = $definition->getConfigPrefix() . '.' . $form_state->getValue('config_name');
}
else {
$name = $form_state->getValue('config_name');
}
// Read the raw data for this config name, encode it, and display it.
$form['export']['#value'] = Yaml::encode($this->configStorage
->read($name));
$form['export']['#description'] = $this->t('Filename: %name', [
'%name' => $name . '.yml',
]);
return $form['export'];
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.