|
@@ 114-123 (lines=10) @@
|
| 111 |
|
return $this->formatters[$name]; |
| 112 |
|
} |
| 113 |
|
|
| 114 |
|
public function formatPage(string $templateId, string $template, array $context) : string |
| 115 |
|
{ |
| 116 |
|
$formatContext = $this->buildFormatContext($templateId, $template, $context); |
| 117 |
|
|
| 118 |
|
if (!$formatContext->formatter()) { |
| 119 |
|
return $template; |
| 120 |
|
} |
| 121 |
|
|
| 122 |
|
return $this->formatter($formatContext->formatter())->formatPage($formatContext); |
| 123 |
|
} |
| 124 |
|
|
| 125 |
|
public function formatSourcePage(SourceInterface $source) : string |
| 126 |
|
{ |
|
@@ 134-143 (lines=10) @@
|
| 131 |
|
); |
| 132 |
|
} |
| 133 |
|
|
| 134 |
|
public function formatBlocks(string $templateId, string $template = null, array $context) : array |
| 135 |
|
{ |
| 136 |
|
$formatContext = $this->buildFormatContext($templateId, $template, $context); |
| 137 |
|
|
| 138 |
|
if (!$formatContext->formatter()) { |
| 139 |
|
return ['content' => $template]; |
| 140 |
|
} |
| 141 |
|
|
| 142 |
|
return $this->formatter($formatContext->formatter())->formatBlocks($formatContext); |
| 143 |
|
} |
| 144 |
|
|
| 145 |
|
public function formatSourceBlocks(SourceInterface $source) : array |
| 146 |
|
{ |