interface BaseFormIdInterface implements FormInterface (View source)

Provides an interface for a Form that has a base form ID.

This will become the $form_state->getBuildInfo()['base_form_id'] used to generate the name of hook_form_BASE_FORM_ID_alter().

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.

string|null
getBaseFormId()

Returns a string identifying the base form.

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.

string|null getBaseFormId()

Returns a string identifying the base form.

Return Value

string|null

The string identifying the base form or NULL if this is not a base form.