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

formatPage() public method

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