public function ConfigDeleteConfirm::buildForm in Demonstration site (Sandbox / Snapshot) 8
.
Overrides ConfirmFormBase::buildForm
File
- src/
Form/ ConfigDeleteConfirm.php, line 26
Class
- ConfigDeleteConfirm
- confirms the deletion of config deletion
Namespace
Drupal\demo\FormCode
public function buildForm(array $form, FormStateInterface $form_state, $filename = NULL) {
$fileconfig = demo_get_fileconfig($filename);
$filename = $fileconfig['dumppath'] . '/' . $filename;
if (!file_exists($filename)) {
\Drupal::messenger()
->addMessage(t('File not found'), 'error');
}
$form['filename'] = [
'#type' => 'value',
'#value' => $filename,
];
return parent::buildForm($form, $form_state);
}