src/Twig/Extension/NetworkingHelperExtension.php
public function renderInitCmsBlock($template, LayoutBlockInterface $layoutBlock, $params = [])
    {
        if (!$serializedContent = $layoutBlock->getSnapshotContent()) {
            // Draft View
            $contentItem = $layoutBlock->getContent();
        } else {
            // Live View
            $contentItem = $this->serializer->deserialize(
                $serializedContent,
                $layoutBlock->getClassType(),
                'json'
            );
        }

        if (!is_object($contentItem)) {
            $this->layoutBlockAdmin->delete($layoutBlock);

            return '---';
        }

        $options = $contentItem->getTemplateOptions($params);

        $options = array_merge($options, $params);

        return $this->templating->render($template, $options);
    }
public function renderInitCmsBlock($template, LayoutBlockInterface $layoutBlock, $params = [])
    {
        if (!$serializedContent = $layoutBlock->getSnapshotContent()) {
            // Draft View
            $contentItem = $layoutBlock->getContent();
        } else {
            // Live View
            $contentItem = $this->serializer->deserialize(
                $serializedContent,
                $layoutBlock->getClassType(),
                'json'
            );
        }

        if (!is_object($contentItem)) {
            $this->layoutBlockAdmin->delete($layoutBlock);

            return '---';
        }

        $options = $contentItem->getTemplateOptions($params);

        $options = array_merge($options, $params);

        return $this->templating->render($template, $options);
    }
public function renderInitCmsBlock ( $ template , LayoutBlockInterface $ layoutBlock , $ params = [ ] ) { if ( ! $ serializedContent = $ layoutBlock -> getSnapshotContent ( ) ) { // Draft View $ contentItem = $ layoutBlock -> getContent ( ) ; } else { // Live View $ contentItem = $ this -> serializer -> deserialize ( $ serializedContent , $ layoutBlock -> getClassType ( ) , 'json' ) ; } if ( ! is_object ( $ contentItem ) ) { $ this -> layoutBlockAdmin -> delete ( $ layoutBlock ) ; return '---' ; } $ options = $ contentItem -> getTemplateOptions ( $ params ) ; $ options = array_merge ( $ options , $ params ) ; return $ this -> templating -> render ( $ template , $ options ) ; }
Returns an HTML block for output in the frontend.

@param $template
@param LayoutBlockInterface $layoutBlock
@param array                $params

@return string
Returns an HTML block for output in the frontend .