function FormAjaxResponseBuilderInterface::buildResponse

Same name in other branches
  1. 9 core/lib/Drupal/Core/Form/FormAjaxResponseBuilderInterface.php \Drupal\Core\Form\FormAjaxResponseBuilderInterface::buildResponse()
  2. 8.9.x core/lib/Drupal/Core/Form/FormAjaxResponseBuilderInterface.php \Drupal\Core\Form\FormAjaxResponseBuilderInterface::buildResponse()
  3. 10 core/lib/Drupal/Core/Form/FormAjaxResponseBuilderInterface.php \Drupal\Core\Form\FormAjaxResponseBuilderInterface::buildResponse()

Builds a response for an AJAX form.

Parameters

\Symfony\Component\HttpFoundation\Request $request: The current request.

array $form: An associative array containing the structure of the form.

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

array $commands: An array of AJAX commands to apply to the form.

Return value

\Drupal\Core\Ajax\AjaxResponse An AJAX response representing the form and its AJAX commands.

Throws

\Symfony\Component\HttpKernel\Exception\HttpException Thrown if the AJAX callback is not a callable.

1 method overrides FormAjaxResponseBuilderInterface::buildResponse()
FormAjaxResponseBuilder::buildResponse in core/lib/Drupal/Core/Form/FormAjaxResponseBuilder.php
Builds a response for an AJAX form.

File

core/lib/Drupal/Core/Form/FormAjaxResponseBuilderInterface.php, line 30

Class

FormAjaxResponseBuilderInterface
Provides an interface for building AJAX form responses.

Namespace

Drupal\Core\Form

Code

public function buildResponse(Request $request, array $form, FormStateInterface $form_state, array $commands);

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