public function ViewsFormBase::getFormState in Drupal 9
Same name and namespace in other branches
- 8 core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php \Drupal\views_ui\Form\Ajax\ViewsFormBase::getFormState()
Gets the form state for this form.
Parameters
\Drupal\views\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
\Drupal\Core\Form\FormStateInterface The current state of the form.
Overrides ViewsFormInterface::getFormState
2 calls to ViewsFormBase::getFormState()
- Display::getFormState in core/
modules/ views_ui/ src/ Form/ Ajax/ Display.php - @todo Remove this and switch all usage of $form_state->get('section') to $form_state->get('type').
- ViewsFormBase::getForm in core/
modules/ views_ui/ src/ Form/ Ajax/ ViewsFormBase.php - Creates a new instance of this form.
1 method overrides ViewsFormBase::getFormState()
- Display::getFormState in core/
modules/ views_ui/ src/ Form/ Ajax/ Display.php - @todo Remove this and switch all usage of $form_state->get('section') to $form_state->get('type').
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\AjaxCode
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);
}