/**
  * @param \Generated\Shared\Transfer\BlockPageResultTransfer $pageBlockResult
  *
  * @return \Symfony\Component\HttpFoundation\JsonResponse
  */
 protected function handleXmlHttpRequest(BlockPageResultTransfer $pageBlockResult)
 {
     $responseBlocks = [];
     foreach ($pageBlockResult->getBlockResults() as $blockResult) {
         $view = $this->renderView('@CmsBlock/block/' . $blockResult->getTemplateName() . '.twig', ['cmsValues' => $blockResult->getCmsValues(), 'dynamicData' => $blockResult->getDynamicData()]);
         $responseBlocks[$blockResult->getBlockName()] = $view->getContent();
     }
     return $this->jsonResponse($responseBlocks);
 }
 /**
  * @param mixed $data
  * @param int $code
  *
  * @return void
  */
 protected function setRawJsonResponse($data, $code = 200)
 {
     $this->pageResult->setRawJsonResponse($data)->setStatusCode($code);
 }
Ejemplo n.º 3
0
 /**
  * @param \Generated\Shared\Transfer\BlockPageResultTransfer $pageResult
  *
  * @return bool
  */
 protected function rawJsonResponseDetected(BlockPageResultTransfer $pageResult)
 {
     return $pageResult->getRawJsonResponse() !== null;
 }