3 namespace Drupal\{{ machine_name }}\Form;
5 use Drupal\Core\Form\ConfirmFormBase;
6 use Drupal\Core\Form\FormStateInterface;
10 * Provides a confirmation form before clearing out the examples.
12 class {{ class }} extends ConfirmFormBase {
17 public function getFormId() {
18 return '{{ form_id }}';
24 public function getQuestion() {
25 return $this->t('Are you sure you want to do this?');
31 public function getCancelUrl() {
32 return new Url('system.admin_config');
38 public function submitForm(array &$form, FormStateInterface $form_state) {
39 // @DCG Place your code here.
40 $this->messenger()->addStatus($this->t('Done!'));
41 $form_state->setRedirectUrl($this->getCancelUrl());