/**
  * @param \Sonata\PageBundle\CmsManager\CmsManagerInterface $manager
  * @param \Sonata\PageBundle\Model\BlockInterface $block
  * @param \Sonata\PageBundle\Model\PageInterface $page
  * @param null|\Symfony\Component\HttpFoundation\Response $response
  * @return null|string|\Symfony\Component\HttpFoundation\Response
  */
 public function execute(CmsManagerInterface $manager, BlockInterface $block, PageInterface $page, Response $response = null)
 {
     $settings = array_merge($this->getDefaultSettings(), $block->getSettings());
     $response = $this->renderResponse('SonataPageBundle:Block:block_container.html.twig', array('container' => $block, 'manager' => $manager, 'page' => $page, 'settings' => $settings), $response);
     $response->setContent(Mustache::replace($settings['layout'], array('CONTENT' => $response->getContent())));
     return $response;
 }
 /**
  * @throws \Exception
  * @param \Sonata\PageBundle\CmsManager\CmsManagerInterface $manager
  * @param \Sonata\PageBundle\Model\BlockInterface $block
  * @param \Sonata\PageBundle\Model\PageInterface $page
  * @param null|\Symfony\Component\HttpFoundation\Response $response
  * @return string
  */
 public function execute(CmsManagerInterface $manager, BlockInterface $block, PageInterface $page, Response $response = null)
 {
     $parameters = (array) json_decode($block->getSetting('parameters'), true);
     $parameters = array_merge($parameters, array('_block' => $block, '_page' => $page));
     $settings = array_merge($this->getDefaultSettings(), (array) $block->getSettings());
     try {
         $actionContent = $this->kernel->render($settings['action'], $parameters);
     } catch (\Exception $e) {
         throw $e;
     }
     $content = Mustache::replace($block->getSetting('layout'), array('CONTENT' => $actionContent));
     return $this->renderResponse('SonataPageBundle:Block:block_core_action.html.twig', array('content' => $content, 'block' => $block, 'page' => $page), $response);
 }