public function YamlFormEntityExportForm::form in YAML Form 8
Gets the actual form array to be built.
Overrides EntityForm::form
See also
\Drupal\Core\Entity\EntityForm::processForm()
\Drupal\Core\Entity\EntityForm::afterBuild()
File
- modules/
yamlform_devel/ src/ Form/ YamlFormEntityExportForm.php, line 19
Class
- YamlFormEntityExportForm
- Export form configuration.
Namespace
Drupal\yamlform_devel\FormCode
public function form(array $form, FormStateInterface $form_state) {
$form['yaml'] = [
'#type' => 'yamlform_codemirror',
'#mode' => 'yaml',
'#title' => $this
->t("Here is your form's configuration:"),
'#description' => $this
->t('Filename: %file', [
'%file' => $this
->getConfigName() . '.yml',
]),
'#default_value' => $this
->getYaml(),
];
return $form;
}