interface ConfirmFormInterface implements FormInterface (View source)

Defines the behavior a confirmation form.

Methods

string
getFormId()

Returns a unique string identifying the form.

array
buildForm(array $form, FormStateInterface $form_state)

Form constructor.

validateForm(array $form, FormStateInterface $form_state)

Form validation handler.

submitForm(array $form, FormStateInterface $form_state)

Form submission handler.

getQuestion()

Returns the question to ask the user.

Url
getCancelUrl()

Returns the route to go to if the user cancels the action.

getDescription()

Returns additional text to display as a description.

getConfirmText()

Returns a caption for the button that confirms the action.

getCancelText()

Returns a caption for the link which cancels the action.

string
getFormName()

Returns the internal name used to refer to the confirmation item.

Details

string getFormId()

Returns a unique string identifying the form.

The returned ID should be a unique string that can be a valid PHP function name, since it's used in hook implementation names such as hook_form_FORM_ID_alter().

Return Value

string

The unique string identifying the form.

array buildForm(array $form, FormStateInterface $form_state)

Form constructor.

Parameters

array $form

An associative array containing the structure of the form.

FormStateInterface $form_state

The current state of the form.

Return Value

array

The form structure.

validateForm(array $form, FormStateInterface $form_state)

Form validation handler.

Parameters

array $form

An associative array containing the structure of the form.

FormStateInterface $form_state

The current state of the form.

submitForm(array $form, FormStateInterface $form_state)

Form submission handler.

Parameters

array $form

An associative array containing the structure of the form.

FormStateInterface $form_state

The current state of the form.

TranslatableMarkup getQuestion()

Returns the question to ask the user.

Return Value

TranslatableMarkup

The form question. The page title will be set to this value.

Url getCancelUrl()

Returns the route to go to if the user cancels the action.

Return Value

Url

A URL object.

TranslatableMarkup getDescription()

Returns additional text to display as a description.

Return Value

TranslatableMarkup

The form description.

TranslatableMarkup getConfirmText()

Returns a caption for the button that confirms the action.

Return Value

TranslatableMarkup

The form confirmation text.

TranslatableMarkup getCancelText()

Returns a caption for the link which cancels the action.

Return Value

TranslatableMarkup

The form cancellation text.

string getFormName()

Returns the internal name used to refer to the confirmation item.

Return Value

string

The internal form name.