3 namespace Drupal\Core\Form;
5 use Symfony\Component\HttpFoundation\Request;
8 * Provides an interface for building AJAX form responses.
10 interface FormAjaxResponseBuilderInterface {
13 * Builds a response for an AJAX form.
15 * @param \Symfony\Component\HttpFoundation\Request $request
16 * The current request.
18 * An associative array containing the structure of the form.
19 * @param \Drupal\Core\Form\FormStateInterface $form_state
20 * The current state of the form.
21 * @param array $commands
22 * An array of AJAX commands to apply to the form.
24 * @return \Drupal\Core\Ajax\AjaxResponse
25 * An AJAX response representing the form and its AJAX commands.
27 * @throws \Symfony\Component\HttpKernel\Exception\HttpException
28 * Thrown if the AJAX callback is not a callable.
30 public function buildResponse(Request $request, array $form, FormStateInterface $form_state, array $commands);