public function EmbedController::previewEditor in Embed 8
Returns an Ajax response to generate preview of an entity.
Expects the the HTML element as GET parameter.
Parameters
\Symfony\Component\HttpFoundation\Request $request: The request object.
\Drupal\editor\EditorInterface $editor: The editor.
\Drupal\embed\EmbedButtonInterface $embed_button: The embed button.
Return value
\Symfony\Component\HttpFoundation\Response The preview of the embedded item specified by the data attributes.
Throws
\Symfony\Component\HttpKernel\Exception\NotFoundHttpException Throws an exception if 'value' parameter is not found in the request.
File
- src/
Controller/ EmbedController.php, line 119
Class
- EmbedController
- Returns responses for Embed module routes.
Namespace
Drupal\embed\ControllerCode
public function previewEditor(Request $request, EditorInterface $editor, EmbedButtonInterface $embed_button) {
return $this
->preview($request, $editor
->getFilterFormat());
}