/** * Renders the comments list for content with id $contentId * Comment form might also be included * * @param mixed $contentId */ public function renderForContentAction( $contentId ) { return new Response( $this->commentsRenderer->renderForContent( $this->contentService->loadContentInfo( $contentId ), $this->request ) ); }
/** * Triggers comments rendering for a given ContentInfo object. * * @param ContentInfo $contentInfo * @param array $options * @param string|null $provider Label of the provider to use. If null, the default provider will be used. * * @return mixed * * @throws \RuntimeException */ public function renderForContent(ContentInfo $contentInfo, array $options = array(), $provider = null) { if (isset($provider)) { $options['provider'] = $provider; } $request = $this->getCurrentRequest(); if (!isset($request)) { throw new RuntimeException('Comments rendering needs the Request.'); } return $this->commentsRenderer->renderForContent($contentInfo, $request, $options); }