Sculpin\Core\Formatter\FormatterManager::formatBlocks PHP Method

formatBlocks() public method

Format blocks
public formatBlocks ( string $templateId, string $template, array $context ) : array
$templateId string Template ID
$template string Template
$context array Context
return array
    public function formatBlocks($templateId, $template, $context)
    {
        $formatContext = $this->buildFormatContext($templateId, $template, $context);
        if (!$formatContext->formatter()) {
            return array('content' => $template);
        }
        $this->eventDispatcher->dispatch(Sculpin::EVENT_BEFORE_FORMAT, new FormatEvent($formatContext));
        $response = $this->formatter($formatContext->formatter())->formatBlocks($formatContext);
        return $response;
    }