I have written a module for Drupal 8 which creates a custom entity type.
In this module, I have a link/route, that updates a field when the user goes to the custom update page and confirms the action, which acts very similar to the delete page (they both extend
submitForm(array &$form, FormStateInterface $form_state) function, I have the following that gets run:
$entity = $this->getEntity(); $entity->setCancel(1); $entity->save(); drupal_set_message(t('Process stopped'));
I would like to avoid needing to go the confirmation page, but I'm not sure what the class should extend from instead of
And ideally, even turn it into an Ajax link/route which I can then use anywhere.
Any help is greatly appreciated