You are here

public function QuickEditController::attachments in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/quickedit/src/QuickEditController.php \Drupal\quickedit\QuickEditController::attachments()
  2. 9 core/modules/quickedit/src/QuickEditController.php \Drupal\quickedit\QuickEditController::attachments()

Returns AJAX commands to load in-place editors' attachments.

Given a list of in-place editor IDs as POST parameters, render AJAX commands to load those in-place editors.

Return value

\Drupal\Core\Ajax\AjaxResponse The Ajax response.

1 string reference to 'QuickEditController::attachments'
quickedit.routing.yml in core/modules/quickedit/quickedit.routing.yml
core/modules/quickedit/quickedit.routing.yml

File

core/modules/quickedit/src/QuickEditController.php, line 199

Class

QuickEditController
Returns responses for Quick Edit module routes.

Namespace

Drupal\quickedit

Code

public function attachments(Request $request) {
  $response = new AjaxResponse();
  if (!$request->request
    ->has('editors')) {
    throw new NotFoundHttpException();
  }
  $editors = $request->request
    ->all('editors');
  $response
    ->setAttachments($this->editorSelector
    ->getEditorAttachments($editors));
  return $response;
}