Twig/Extension/SimpleContentExtension.php
public function contentBlockFilter($defaultContent, $name, $type = 'line', $locale = null, $useLocaleFallback = null)
    {
        $block = $this->contentService->getOrCreateContentBlock($name, $locale, $useLocaleFallback, $type, $defaultContent);

        if (null === $locale || (null !== $this->translator && $this->translator->getLocale() == $locale))
        {
            return $this->renderContent($block);
        }

        return '';
    }
public function contentBlockFilter($defaultContent, $name, $type = 'line', $locale = null, $useLocaleFallback = null)
    {
        $block = $this->contentService->getOrCreateContentBlock($name, $locale, $useLocaleFallback, $type, $defaultContent);

        if (null === $locale || (null !== $this->translator && $this->translator->getLocale() == $locale))
        {
            return $this->renderContent($block);
        }

        return '';
    }
public function contentBlockFilter ( $ defaultContent , $ name , $ type = 'line' , $ locale = null , $ useLocaleFallback = null ) { $ block = $ this -> contentService -> getOrCreateContentBlock ( $ name , $ locale , $ useLocaleFallback , $ type , $ defaultContent ) ; if ( null === $ locale || ( null !== $ this -> translator && $ this -> translator -> getLocale ( ) == $ locale ) ) { return $ this -> renderContent ( $ block ) ; } return '' ; }
Fetch content block with the given default content and name.
This allows to wrap existing content with a filter block.

If a locale different from the current locale is given, the block is fetched/created,
but not displayed.

Implemented / allowed types so far:
* line      Single line, escaped (default)
* text      Multiline, escaped
* markdown  Markdown, not escaped
* html      HTML, not escaped

@throws \InvalidArgumentException    If given type is unknown

@param string $defaultContent    Default content to assign if block has to be created
@param string $name              Block name
@param string $type              Block type (defaults to 'line')
@param string $locale            Specific locale to use instead of current locale
@param string $useLocaleFallback Override global use_locale_fallback setting

@return string
Fetch content block with the given default content and name . This allows to wrap existing content with a filter block .