X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=vendor%2Fchi-teck%2Fdrupal-code-generator%2Ftemplates%2Fd8%2Fform%2Fconfirm.twig;fp=vendor%2Fchi-teck%2Fdrupal-code-generator%2Ftemplates%2Fd8%2Fform%2Fconfirm.twig;h=4e28d6498c5deb4d2bff7c33cc0c442616a7da23;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hp=0000000000000000000000000000000000000000;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0;p=yaffs-website diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/form/confirm.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/form/confirm.twig new file mode 100644 index 000000000..4e28d6498 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/form/confirm.twig @@ -0,0 +1,72 @@ +connection = $connection; + } + + /** + * {@inheritdoc} + */ + public static function create(ContainerInterface $container) { + return new static( + $container->get('database') + ); + } + + /** + * {@inheritdoc} + */ + public function getFormId() { + return '{{ form_id }}'; + } + + /** + * {@inheritdoc} + */ + public function getQuestion() { + return $this->t('Are you sure you want to delete all examples?'); + } + + /** + * {@inheritdoc} + */ + public function getCancelUrl() { + return new Url('system.admin'); + } + + /** + * {@inheritdoc} + */ + public function submitForm(array &$form, FormStateInterface $form_state) { + $this->connection->delete('examples')->execute(); + drupal_set_message($this->t('The examples have been deleted.')); + $form_state->setRedirectUrl($this->getCancelUrl()); + } + +}