Controller/WebsiteArticleController.php
protected function renderArticle(Request $request, ArticleInterface $object, $view, $pageNumber, $attributes = [])
    {
        $object = $this->normalizeArticle($object);

        $requestFormat = $request->getRequestFormat();
        $viewTemplate = $view . '.' . $requestFormat . '.twig';

        $content = $this->serializeArticle($object, $pageNumber);

        try {
            return $this->render(
                $viewTemplate,
                $this->get('sulu_website.resolver.template_attribute')->resolve(array_merge($content, $attributes)),
                $this->createResponse($request)
            );
        } catch (\InvalidArgumentException $exception) {
            // template not found
            throw new HttpException(406, 'Error encountered when rendering content', $exception);
        }
    }
protected function renderArticle(Request $request, ArticleInterface $object, $view, $pageNumber, $attributes = [])
    {
        $object = $this->normalizeArticle($object);

        $requestFormat = $request->getRequestFormat();
        $viewTemplate = $view . '.' . $requestFormat . '.twig';

        $content = $this->serializeArticle($object, $pageNumber);

        try {
            return $this->render(
                $viewTemplate,
                $this->get('sulu_website.resolver.template_attribute')->resolve(array_merge($content, $attributes)),
                $this->createResponse($request)
            );
        } catch (\InvalidArgumentException $exception) {
            // template not found
            throw new HttpException(406, 'Error encountered when rendering content', $exception);
        }
    }
protected function renderArticle ( Request $ request , ArticleInterface $ object , $ view , $ pageNumber , $ attributes = [ ] ) { $ object = $ this -> normalizeArticle ( $ object ) ; $ requestFormat = $ request -> getRequestFormat ( ) ; $ viewTemplate = $ view . '.' . $ requestFormat . '.twig' ; $ content = $ this -> serializeArticle ( $ object , $ pageNumber ) ; try { return $ this -> render ( $ viewTemplate , $ this -> get ( 'sulu_website.resolver.template_attribute' ) -> resolve ( array_merge ( $ content , $ attributes ) ) , $ this -> createResponse ( $ request ) ) ; } catch ( \ InvalidArgumentException $ exception ) { // template not found throw new HttpException ( 406 , 'Error encountered when rendering content' , $ exception ) ; } }
Render article with given view.

@param Request $request
@param ArticleInterface $object
@param string $view
@param int $pageNumber
@param array $attributes

@return Response
Render article with given view .