File
-
src/
Renderer.php, line 36
Class
- Renderer
- Render content in a colorbox.
Namespace
Drupal\colorbox_loadCode
public function renderResponse(array $main_content, Request $request, RouteMatchInterface $route_match) {
$response = new AjaxResponse();
$content = $this->renderer
->renderPlain($main_content);
$response->setAttachments($main_content['#attached']);
$response->addCommand(new OpenCommand($content));
return $response;
}