You are here

public function MediaController::autocomplete in Gutenberg 8

Same name and namespace in other branches
  1. 8.2 src/Controller/MediaController.php \Drupal\gutenberg\Controller\MediaController::autocomplete()

Get data for autocomplete.

Parameters

\Symfony\Component\HttpFoundation\Request $request: Current request.

Return value

\Symfony\Component\HttpFoundation\JsonResponse The JSON response.

1 string reference to 'MediaController::autocomplete'
gutenberg.routing.yml in ./gutenberg.routing.yml
gutenberg.routing.yml

File

src/Controller/MediaController.php, line 256

Class

MediaController
Returns responses for our image routes.

Namespace

Drupal\gutenberg\Controller

Code

public function autocomplete(Request $request) {
  return new JsonResponse($this->mediaService
    ->getMediaEntityAutoCompleteData($request
    ->get('search', '')));
}