.. include:: /Includes.rst.txt
.. _template-rendering:
==================
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.
.. php:namespace:: EliasHaeussler\Typo3Solver\View
.. php:class:: 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.
.. php:method:: render($templatePath, $variables = [])
Render a given template with optional variables. The
template path must be relative to
:file:`EXT:solver/Resources/Private/Templates`.
:param string $exception: Path to the template to be rendered
:param array $variables: Optional template variables
:returntype: string
.. _view-helpers:
View helpers
============
The extension provides two additional view helpers.
.. php:namespace:: EliasHaeussler\Typo3Solver\ViewHelpers
.. php:class:: DateViewHelper
View helper to format a given date, either by a fixed format
(:php:`d.m.Y H:i:s`) or as human readable relative date.
Examples:
.. code-block:: html
.. code-block:: html
.. php:class:: 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:
.. code-block:: html
.. code-block:: html
.. seealso::
View the sources on GitHub:
- `DateViewHelper `__
- `MarkdownToHtmlViewHelper `__