You are here

protected function ViewsForm::getFormObject in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/views/src/Form/ViewsForm.php \Drupal\views\Form\ViewsForm::getFormObject()

Returns the object used to build the step form.

Parameters

\Drupal\Core\Form\FormStateInterface $form_state: The form_state of the current form.

Return value

\Drupal\Core\Form\FormInterface The form object to use.

3 calls to ViewsForm::getFormObject()
ViewsForm::buildForm in core/modules/views/src/Form/ViewsForm.php
Form constructor.
ViewsForm::submitForm in core/modules/views/src/Form/ViewsForm.php
Form submission handler.
ViewsForm::validateForm in core/modules/views/src/Form/ViewsForm.php
Form validation handler.

File

core/modules/views/src/Form/ViewsForm.php, line 199

Class

ViewsForm
Provides a base class for single- or multistep view forms.

Namespace

Drupal\views\Form

Code

protected function getFormObject(FormStateInterface $form_state) {

  // If this is a class, instantiate it.
  $form_step_class = $form_state
    ->get([
    'step_controller',
    $form_state
      ->get('step'),
  ]) ?: 'Drupal\\views\\Form\\ViewsFormMainForm';
  return $this->classResolver
    ->getInstanceFromDefinition($form_step_class);
}