function FormAjaxResponseBuilder::__construct

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/Form/FormAjaxResponseBuilder.php \Drupal\Core\Form\FormAjaxResponseBuilder::__construct()
  2. 10 core/lib/Drupal/Core/Form/FormAjaxResponseBuilder.php \Drupal\Core\Form\FormAjaxResponseBuilder::__construct()
  3. 9 core/lib/Drupal/Core/Form/FormAjaxResponseBuilder.php \Drupal\Core\Form\FormAjaxResponseBuilder::__construct()
  4. 8.9.x core/lib/Drupal/Core/Form/FormAjaxResponseBuilder.php \Drupal\Core\Form\FormAjaxResponseBuilder::__construct()

File

core/lib/Drupal/Core/Form/FormAjaxResponseBuilder.php, line 40

Class

FormAjaxResponseBuilder
Builds an AJAX form response.

Namespace

Drupal\Core\Form

Code

public function __construct(MainContentRendererInterface $ajax_renderer, RouteMatchInterface $route_match, ?CallableResolver $callableResolver = NULL) {
  $this->ajaxRenderer = $ajax_renderer;
  $this->routeMatch = $route_match;
  if (!$callableResolver) {
    @trigger_error(sprintf('Calling %s() without the $callableResolver param is deprecated in drupal:11.3.0 and is required in drupal:12.0.0. See https://www.drupal.org/node/3548821', __METHOD__), E_USER_DEPRECATED);
    $callableResolver = \Drupal::service(CallableResolver::class);
  }
  $this->callableResolver = $callableResolver;
}

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