interface FormAjaxResponseBuilderInterface (View source)

Provides an interface for building AJAX form responses.

Methods

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

Builds a response for an AJAX form.

Details

AjaxResponse buildResponse(Request $request, array $form, FormStateInterface $form_state, array $commands)

Builds a response for an AJAX form.

Parameters

Request $request

The current request.

array $form

An associative array containing the structure of the form.

FormStateInterface $form_state

The current state of the form.

array $commands

An array of AJAX commands to apply to the form.

Return Value

AjaxResponse

An AJAX response representing the form and its AJAX commands.

Exceptions

HttpException