ConfirmFormInterface.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. namespace Drupal\Core\Form;
  3. /**
  4. * Defines the behavior a confirmation form.
  5. */
  6. interface ConfirmFormInterface extends FormInterface {
  7. /**
  8. * Returns the question to ask the user.
  9. *
  10. * @return \Drupal\Core\StringTranslation\TranslatableMarkup
  11. * The form question. The page title will be set to this value.
  12. */
  13. public function getQuestion();
  14. /**
  15. * Returns the route to go to if the user cancels the action.
  16. *
  17. * @return \Drupal\Core\Url
  18. * A URL object.
  19. */
  20. public function getCancelUrl();
  21. /**
  22. * Returns additional text to display as a description.
  23. *
  24. * @return \Drupal\Core\StringTranslation\TranslatableMarkup
  25. * The form description.
  26. */
  27. public function getDescription();
  28. /**
  29. * Returns a caption for the button that confirms the action.
  30. *
  31. * @return \Drupal\Core\StringTranslation\TranslatableMarkup
  32. * The form confirmation text.
  33. */
  34. public function getConfirmText();
  35. /**
  36. * Returns a caption for the link which cancels the action.
  37. *
  38. * @return \Drupal\Core\StringTranslation\TranslatableMarkup
  39. * The form cancellation text.
  40. */
  41. public function getCancelText();
  42. /**
  43. * Returns the internal name used to refer to the confirmation item.
  44. *
  45. * @return string
  46. * The internal form name.
  47. */
  48. public function getFormName();
  49. }