Template rendering

Since exception handling may happen on a very low level where TYPO3 bootstrapping is not completed yet, this extension ships with a very generic template renderer.

Note

This is an internal component and not part of the public API.

class EliasHaeussler\Typo3Solver\View\TemplateRenderer

Generic low-level renderer for Fluid templates shipped with EXT:solver. This class is not intended for use anywhere else than in the extension itself.

render($templatePath, $variables = [])

Render a given template with optional variables. The template path must be relative to EXT:solver/Resources/Private/Templates.

Parameters
  • $exception (string) -- Path to the template to be rendered

  • $variables (array) -- Optional template variables

Return type

string

View helpers

The extension provides two additional view helpers.

class EliasHaeussler\Typo3Solver\ViewHelpers\DateViewHelper

View helper to format a given date, either by a fixed format (d.m.Y H:i:s) or as human readable relative date.

Examples:

<solver:date date="{date}" /> <!-- 12.04.2023 19:51:02 -->
<solver:date date="{date}" readable="1" /> <!-- 2 hours ago -->
class EliasHaeussler\Typo3Solver\ViewHelpers\MarkdownToHtmlViewHelper

View helper to convert a given Markdown string to HTML. It uses the erusev/parsedown library internally. In addition, resolved HTML can also be modified by replacing line numbers in code snippets to match the expected structure of code examples on error pages.

Examples:

<solver:markdownToHtml markdown="{markdown}" />
<solver:markdownToHtml markdown="{markdown}" replaceLineNumbersInCodeSnippets="1" />

See also

View the sources on GitHub: