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;
}