public function render(Content $content, $parameters)
    {
        if(!array_key_exists($content->getType(), $this->filters))
        {
            throw new RenderException(
                'Content filter [' . $content->getType() . '] not found. Available filters: ' .
                implode(', ', array_keys($this->filters)) . '.'
            );
        }

        $renderedContent = $this->filters[$content->getType()]->render($content, $parameters);

        if(preg_match_all('/\{\{\s*(include)\s+([a-z0-9\_\-\.\/]+)\s*\}\}/i', $renderedContent, $matches))
        {
            $matchesCount = count($matches[0]);
            for($i = 0; $i < $matchesCount; $i++)
            {
                $includedContent = $this->renderIncludeForContent($content, $matches[2][$i], $parameters);
                $renderedContent = str_replace($matches[0][$i], $includedContent, $renderedContent);
            }
        }

        return $renderedContent;
    }
public function render(Content $content, $parameters)
    {
        if(!array_key_exists($content->getType(), $this->filters))
        {
            throw new RenderException(
                'Content filter [' . $content->getType() . '] not found. Available filters: ' .
                implode(', ', array_keys($this->filters)) . '.'
            );
        }

        $renderedContent = $this->filters[$content->getType()]->render($content, $parameters);

        if(preg_match_all('/\{\{\s*(include)\s+([a-z0-9\_\-\.\/]+)\s*\}\}/i', $renderedContent, $matches))
        {
            $matchesCount = count($matches[0]);
            for($i = 0; $i < $matchesCount; $i++)
            {
                $includedContent = $this->renderIncludeForContent($content, $matches[2][$i], $parameters);
                $renderedContent = str_replace($matches[0][$i], $includedContent, $renderedContent);
            }
        }

        return $renderedContent;
    }
public function render ( Content $ content , $ parameters ) { if ( ! array_key_exists ( $ content -> getType ( ) , $ this -> filters ) ) { throw new RenderException ( 'Content filter [' . $ content -> getType ( ) . '] not found. Available filters: ' . implode ( ', ' , array_keys ( $ this -> filters ) ) . '.' ) ; } $ renderedContent = $ this -> filters [ $ content -> getType ( ) ] -> render ( $ content , $ parameters ) ; if ( preg_match_all ( '/\{\{\s*(include)\s+([a-z0-9\_\-\.\/]+)\s*\}\}/i' , $ renderedContent , $ matches ) ) { $ matchesCount = count ( $ matches [ 0 ] ) ; for ( $ i = 0 ; $ i < $ matchesCount ; $ i ++ ) { $ includedContent = $ this -> renderIncludeForContent ( $ content , $ matches [ 2 ] [ $ i ] , $ parameters ) ; $ renderedContent = str_replace ( $ matches [ 0 ] [ $ i ] , $ includedContent , $ renderedContent ) ; } } return $ renderedContent ; }
Render Content via a filter

@param  Content $content    Content to render
@param  array   $parameters Parameters from template
@return string
Render Content via a filter