function ViewsFormAjaxHelperTrait::ajaxUpdateForm

Provides a triggering element Ajax callback.

Parameters

array $form: The form render array.

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

Return value

array Render array.

File

core/modules/views/src/ViewsFormAjaxHelperTrait.php, line 225

Class

ViewsFormAjaxHelperTrait
Provides reusable code to be shared by Views Ajax forms.

Namespace

Drupal\views

Code

public function ajaxUpdateForm(array $form, FormStateInterface $formState) : array {
  // The region that needs to be updated was stored in a property of the
  // triggering element by self::addAjaxTrigger(), so all we have to do is
  // retrieve that here.
  // @see \Drupal\views\ViewsFormAjaxHelperTrait::addAjaxTrigger()
  return NestedArray::getValue($form, $formState->getTriggeringElement()['#views_ui_ajax_data']['refresh_parents']);
}

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