Version 1
[yaffs-website] / web / core / lib / Drupal / Core / Form / FormAjaxResponseBuilderInterface.php
1 <?php
2
3 namespace Drupal\Core\Form;
4
5 use Symfony\Component\HttpFoundation\Request;
6
7 /**
8  * Provides an interface for building AJAX form responses.
9  */
10 interface FormAjaxResponseBuilderInterface {
11
12   /**
13    * Builds a response for an AJAX form.
14    *
15    * @param \Symfony\Component\HttpFoundation\Request $request
16    *   The current request.
17    * @param array $form
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.
23    *
24    * @return \Drupal\Core\Ajax\AjaxResponse
25    *   An AJAX response representing the form and its AJAX commands.
26    *
27    * @throws \Symfony\Component\HttpKernel\Exception\HttpException
28    *   Thrown if the AJAX callback is not a callable.
29    */
30   public function buildResponse(Request $request, array $form, FormStateInterface $form_state, array $commands);
31
32 }