public function renderBlock($name)
    {
        /** @var Block $block */
        $block = $this->repositories['block']->findOneBy(array('name' => $name));
        if (!$block || (!$block->isPublished() && !$this->security->isGranted('ROLE_ADMIN'))) {
            return;
        }

        return $block->getContents();
    }
public function renderBlock($name)
    {
        /** @var Block $block */
        $block = $this->repositories['block']->findOneBy(array('name' => $name));
        if (!$block || (!$block->isPublished() && !$this->security->isGranted('ROLE_ADMIN'))) {
            return;
        }

        return $block->getContents();
    }
public function renderBlock ( $ name ) { /** @var Block $block */ $ block = $ this -> repositories [ 'block' ] -> findOneBy ( array ( 'name' => $ name ) ) ; if ( ! $ block || ( ! $ block -> isPublished ( ) && ! $ this -> security -> isGranted ( 'ROLE_ADMIN' ) ) ) { return ; } return $ block -> getContents ( ) ; }
Render a Block

@author Vincent Chalamon <vincentchalamon@gmail.com>

@param string $name Block name

@return null|string
Render a Block