public function renderContentEmbed($contentId, $viewType, array $parameters, $isInline) { $isDenied = false; try { $this->checkContent($contentId); } catch (AccessDeniedException $e) { if (isset($this->logger)) { $this->logger->error("Could not render embedded resource: access denied to embed Content #{$contentId}"); } $isDenied = true; } catch (Exception $e) { if ($e instanceof NotFoundHttpException || $e instanceof NotFoundException) { if (isset($this->logger)) { $this->logger->error("Could not render embedded resource: Content #{$contentId} not found"); } return null; } else { throw $e; } } $templateName = $this->getEmbedTemplateName(static::RESOURCE_TYPE_CONTENT, $isInline, $isDenied); if ($templateName === null) { $this->logger->error('Could not render embedded resource: no template configured'); return null; } if (!$this->templateEngine->exists($templateName)) { if (isset($this->logger)) { $this->logger->error("Could not render embedded resource: template '{$templateName}' does not exists"); } return null; } return $this->render($templateName, $parameters); }