public function renderContainer($container, $type = null, array $data = [])
    {
        if (is_string($container)) {
            if (null === $element = $this->editor->getRepository()->findContainerByName($container)) {
                $this->persist($element = $this->editor->getContainerManager()->create($container, $type, $data));
            }
            $container = $element;
        }

        if ($container instanceof EM\ContainerInterface) {
            $this->tagManager->addTags($container->getEntityTag());

            $container = $this->editor->getViewBuilder()->buildContainer($container);
        }

        if (!$container instanceof View\ContainerView) {
            throw new Exception\InvalidArgumentException(
                'Expected string or instance of ' .
                EM\ContainerInterface::class . ' or ' .
                View\ContainerView::class
            );
        }

        /** @noinspection PhpInternalEntityUsedInspection */
        return $this->getTemplate()->renderBlock('cms_container', [
            'container' => $container,
        ]);
    }
public function renderContainer($container, $type = null, array $data = [])
    {
        if (is_string($container)) {
            if (null === $element = $this->editor->getRepository()->findContainerByName($container)) {
                $this->persist($element = $this->editor->getContainerManager()->create($container, $type, $data));
            }
            $container = $element;
        }

        if ($container instanceof EM\ContainerInterface) {
            $this->tagManager->addTags($container->getEntityTag());

            $container = $this->editor->getViewBuilder()->buildContainer($container);
        }

        if (!$container instanceof View\ContainerView) {
            throw new Exception\InvalidArgumentException(
                'Expected string or instance of ' .
                EM\ContainerInterface::class . ' or ' .
                View\ContainerView::class
            );
        }

        /** @noinspection PhpInternalEntityUsedInspection */
        return $this->getTemplate()->renderBlock('cms_container', [
            'container' => $container,
        ]);
    }
public function renderContainer ( $ container , $ type = null , array $ data = [ ] ) { if ( is_string ( $ container ) ) { if ( null === $ element = $ this -> editor -> getRepository ( ) -> findContainerByName ( $ container ) ) { $ this -> persist ( $ element = $ this -> editor -> getContainerManager ( ) -> create ( $ container , $ type , $ data ) ) ; } $ container = $ element ; } if ( $ container instanceof EM \ ContainerInterface ) { $ this -> tagManager -> addTags ( $ container -> getEntityTag ( ) ) ; $ container = $ this -> editor -> getViewBuilder ( ) -> buildContainer ( $ container ) ; } if ( ! $ container instanceof View \ ContainerView ) { throw new Exception \ InvalidArgumentException ( 'Expected string or instance of ' . EM \ ContainerInterface :: class . ' or ' . View \ ContainerView :: class ) ; } /** @noinspection PhpInternalEntityUsedInspection */ return $ this -> getTemplate ( ) -> renderBlock ( 'cms_container' , [ 'container' => $ container , ] ) ; }
Renders the container.

@param string|EM\ContainerInterface|View\ContainerView $container
@param string                                          $type
@param array                                           $data

@return string
@throws Exception\InvalidArgumentException
Renders the container .