public function getAction($type, $uid, Request $request)
    {
        $this->granted('VIEW', $content = $this->getClassContentByTypeAndUid($type, $uid, true));

        $response = null;
        if (in_array('text/html', $request->getAcceptableContentTypes())) {
            if (false != $pageUid = $request->query->get('page_uid')) {
                if (null !== $page = $this->getEntityManager()->find('BackBee\NestedNode\Page', $pageUid)) {
                    $this->getApplication()->getRenderer()->setCurrentPage($page);
                }
            }

            $mode = $request->query->get('mode', null);
            $response = $this->createResponse(
                $this->getApplication()->getRenderer()->render($content, $mode), 200, 'text/html'
            );
        } else {
            $response = $this->createJsonResponse();
            $response->setData($this->getClassContentManager()->jsonEncode($content, $this->getFormatParam()));
        }

        return $response;
    }
public function getAction($type, $uid, Request $request)
    {
        $this->granted('VIEW', $content = $this->getClassContentByTypeAndUid($type, $uid, true));

        $response = null;
        if (in_array('text/html', $request->getAcceptableContentTypes())) {
            if (false != $pageUid = $request->query->get('page_uid')) {
                if (null !== $page = $this->getEntityManager()->find('BackBee\NestedNode\Page', $pageUid)) {
                    $this->getApplication()->getRenderer()->setCurrentPage($page);
                }
            }

            $mode = $request->query->get('mode', null);
            $response = $this->createResponse(
                $this->getApplication()->getRenderer()->render($content, $mode), 200, 'text/html'
            );
        } else {
            $response = $this->createJsonResponse();
            $response->setData($this->getClassContentManager()->jsonEncode($content, $this->getFormatParam()));
        }

        return $response;
    }
public function getAction ( $ type , $ uid , Request $ request ) { $ this -> granted ( 'VIEW' , $ content = $ this -> getClassContentByTypeAndUid ( $ type , $ uid , true ) ) ; $ response = null ; if ( in_array ( 'text/html' , $ request -> getAcceptableContentTypes ( ) ) ) { if ( false != $ pageUid = $ request -> query -> get ( 'page_uid' ) ) { if ( null !== $ page = $ this -> getEntityManager ( ) -> find ( 'BackBee\NestedNode\Page' , $ pageUid ) ) { $ this -> getApplication ( ) -> getRenderer ( ) -> setCurrentPage ( $ page ) ; } } $ mode = $ request -> query -> get ( 'mode' , null ) ; $ response = $ this -> createResponse ( $ this -> getApplication ( ) -> getRenderer ( ) -> render ( $ content , $ mode ) , 200 , 'text/html' ) ; } else { $ response = $ this -> createJsonResponse ( ) ; $ response -> setData ( $ this -> getClassContentManager ( ) -> jsonEncode ( $ content , $ this -> getFormatParam ( ) ) ) ; } return $ response ; }
Get classcontent.

@param string $type type of the class content (ex: Element/text)
@param string $uid  identifier of the class content

@return Symfony\Component\HttpFoundation\Response

@Rest\QueryParam(name="mode", description="The render mode to use")
@Rest\QueryParam(name="page_uid", description="The page to set to application's renderer before rendering")

@Rest\Security("is_fully_authenticated() & has_role('ROLE_API_USER')")
Get classcontent .