function ViewsFormBase::getFormState

Same name and namespace in other branches
  1. 11.x core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php \Drupal\views_ui\Form\Ajax\ViewsFormBase::getFormState()
  2. 10 core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php \Drupal\views_ui\Form\Ajax\ViewsFormBase::getFormState()
  3. 8.9.x core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php \Drupal\views_ui\Form\Ajax\ViewsFormBase::getFormState()

File

core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php, line 69

Class

ViewsFormBase
Provides a base class for Views UI AJAX forms.

Namespace

Drupal\views_ui\Form\Ajax

Code

public function getFormState(ViewEntityInterface $view, $display_id, $js) {
  // $js may already have been converted to a Boolean.
  $ajax = is_string($js) ? $js === 'ajax' : $js;
  return (new FormState())->set('form_id', $this->getFormId())
    ->set('form_key', $this->getFormKey())
    ->set('ajax', $ajax)
    ->set('display_id', $display_id)
    ->set('view', $view)
    ->set('type', $this->type)
    ->set('id', $this->id)
    ->disableRedirect()
    ->addBuildInfo('callback_object', $this);
}

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