Jarves\Controller\Admin\AdminController::getContentPreviewAction PHP Метод

getContentPreviewAction() публичный Метод

public getContentPreviewAction ( FOS\RestBundle\Request\ParamFetcher $paramFetcher ) : array
$paramFetcher FOS\RestBundle\Request\ParamFetcher
Результат array
    public function getContentPreviewAction(ParamFetcher $paramFetcher)
    {
        $template = $paramFetcher->get('template');
        $type = $paramFetcher->get('type');
        $content = $paramFetcher->get('content');
        $nodeId = $paramFetcher->get('nodeId');
        $domainId = $paramFetcher->get('domainId');
        //todo, check if $template is defined as content template
        $contentObject = new Content();
        $contentObject->setType($type);
        $contentObject->setTemplate($template);
        $contentObject->setContent($content);
        if ($domainId) {
            $domain = $this->pageStack->getDomain($domainId);
            $this->pageStack->setCurrentDomain($domain);
        }
        if ($nodeId) {
            $page = $this->pageStack->getPage($nodeId);
            $this->pageStack->setCurrentPage($page);
        }
        return $this->contentRender->renderContent($contentObject, ['preview' => true]);
    }