function ViewsForm::getFormObject

Same name and namespace in other branches
  1. 9 core/modules/views/src/Form/ViewsForm.php \Drupal\views\Form\ViewsForm::getFormObject()
  2. 8.9.x core/modules/views/src/Form/ViewsForm.php \Drupal\views\Form\ViewsForm::getFormObject()
  3. 10 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 202

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);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.