interface ViewsFormInterface implements FormInterface (View source)

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
getFormKey()

Returns the key that represents this form.

getFormState(ViewEntityInterface $view, string|null $display_id, string $js)

Gets the form state for this form.

array
getForm(ViewEntityInterface $view, string|null $display_id, string $js)

Creates a new instance of this 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 getFormKey()

Returns the key that represents this form.

Return Value

string

The form key used in the URL, e.g., the string 'add-handler' in 'admin/structure/views/%/add-handler/%/%/%'.

FormStateInterface getFormState(ViewEntityInterface $view, string|null $display_id, string $js)

Gets the form state for this form.

Parameters

ViewEntityInterface $view

The view being edited.

string|null $display_id

The display ID being edited, or NULL to load the first available display.

string $js

If this is an AJAX form, it will be the string 'ajax'. Otherwise, it will be 'nojs'. This determines the response.

Return Value

FormStateInterface

The current state of the form.

array getForm(ViewEntityInterface $view, string|null $display_id, string $js)

Creates a new instance of this form.

When https://www.drupal.org/node/1843224 is in, this will return \Drupal\Core\Ajax\AjaxResponse instead of the array of AJAX commands.

Parameters

ViewEntityInterface $view

The view being edited.

string|null $display_id

The display ID being edited, or NULL to load the first available display.

string $js

If this is an AJAX form, it will be the string 'ajax'. Otherwise, it will be 'nojs'. This determines the response.

Return Value

array

An form for a specific operation in the Views UI, or an array of AJAX commands to render a form.