903bb1e13e07054be93fef484cb40fcd22567073
[yaffs-website] / vendor / chi-teck / drupal-code-generator / templates / d8 / form / confirm.twig
1 <?php
2
3 namespace Drupal\{{ machine_name }}\Form;
4
5 use Drupal\Core\Form\ConfirmFormBase;
6 use Drupal\Core\Form\FormStateInterface;
7 use Drupal\Core\Url;
8
9 /**
10  * Provides a confirmation form before clearing out the examples.
11  */
12 class {{ class }} extends ConfirmFormBase {
13
14   /**
15    * {@inheritdoc}
16    */
17   public function getFormId() {
18     return '{{ form_id }}';
19   }
20
21   /**
22    * {@inheritdoc}
23    */
24   public function getQuestion() {
25     return $this->t('Are you sure you want to do this?');
26   }
27
28   /**
29    * {@inheritdoc}
30    */
31   public function getCancelUrl() {
32     return new Url('system.admin_config');
33   }
34
35   /**
36    * {@inheritdoc}
37    */
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());
42   }
43
44 }