‪TYPO3CMS  10.4
TYPO3\CMS\Fluid\ViewHelpers\Format\HtmlViewHelper Class Reference
Inheritance diagram for TYPO3\CMS\Fluid\ViewHelpers\Format\HtmlViewHelper:

Public Member Functions

 initializeArguments ()
 

Static Public Member Functions

static string renderStatic (array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
 

Static Protected Member Functions

static simulateFrontendEnvironment ()
 
static resetFrontendEnvironment ()
 

Protected Attributes

bool $escapeChildren = false
 
bool $escapeOutput = false
 

Static Protected Attributes

static TYPO3 CMS Frontend Controller TypoScriptFrontendController $tsfeBackup
 

Detailed Description

Renders a string by passing it to a TYPO3 parseFunc_. You can either specify a path to the TypoScript setting or set the parseFunc_ options directly. By default :typoscript:lib.parseFunc_RTE is used to parse the string.

Examples

Default parameters

::

<f:format.html>foo bar. Some <LINK 1>link</LINK>.</f:format.html>

Output::

foo bar. Some link.

Depending on TYPO3 setup.

Custom parseFunc

::

<f:format.html parseFuncTSPath="lib.parseFunc">foo bar. Some <LINK 1>link</LINK>.</f:format.html>

Output::

foo bar. Some link.

Inline notation

::

{someText -> f:format.html(parseFuncTSPath: 'lib.parseFunc')}

Output::

foo bar. Some link.

.. _parseFunc: https://docs.typo3.org/m/typo3/reference-typoscript/master/en-us/Functions/Parsefunc.html

Definition at line 71 of file HtmlViewHelper.php.

Member Function Documentation

◆ initializeArguments()

TYPO3\CMS\Fluid\ViewHelpers\Format\HtmlViewHelper::initializeArguments ( )

Initialize arguments.

Exceptions

Definition at line 95 of file HtmlViewHelper.php.

◆ renderStatic()

static string TYPO3\CMS\Fluid\ViewHelpers\Format\HtmlViewHelper::renderStatic ( array  $arguments,
\Closure  $renderChildrenClosure,
RenderingContextInterface  $renderingContext 
)
static
Parameters
array$arguments
\Closure$renderChildrenClosure
RenderingContextInterface$renderingContext
Returns
‪string the parsed string.

Definition at line 107 of file HtmlViewHelper.php.

References TYPO3\CMS\Fluid\ViewHelpers\Format\HtmlViewHelper\resetFrontendEnvironment(), and TYPO3\CMS\Fluid\ViewHelpers\Format\HtmlViewHelper\simulateFrontendEnvironment().

◆ resetFrontendEnvironment()

static TYPO3\CMS\Fluid\ViewHelpers\Format\HtmlViewHelper::resetFrontendEnvironment ( )
staticprotected

◆ simulateFrontendEnvironment()

static TYPO3\CMS\Fluid\ViewHelpers\Format\HtmlViewHelper::simulateFrontendEnvironment ( )
staticprotected

Copies the specified parseFunc configuration to $GLOBALS['TSFE']->tmpl->setup in Backend mode This somewhat hacky work around is currently needed because the parseFunc() function of \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer relies on those variables to be set

Definition at line 127 of file HtmlViewHelper.php.

References $GLOBALS, and TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface\CONFIGURATION_TYPE_FULL_TYPOSCRIPT.

Referenced by TYPO3\CMS\Fluid\ViewHelpers\Format\HtmlViewHelper\renderStatic().

Member Data Documentation

◆ $escapeChildren

bool TYPO3\CMS\Fluid\ViewHelpers\Format\HtmlViewHelper::$escapeChildren = false
protected

Children must not be escaped, to be able to pass {bodytext} directly to it

Definition at line 82 of file HtmlViewHelper.php.

◆ $escapeOutput

bool TYPO3\CMS\Fluid\ViewHelpers\Format\HtmlViewHelper::$escapeOutput = false
protected

Plain HTML should be returned, no output escaping allowed

Definition at line 88 of file HtmlViewHelper.php.

◆ $tsfeBackup

TYPO3 CMS Frontend Controller TypoScriptFrontendController TYPO3\CMS\Fluid\ViewHelpers\Format\HtmlViewHelper::$tsfeBackup
staticprotected

contains a backup of the current $GLOBALS['TSFE'] if used in BE mode

Definition at line 76 of file HtmlViewHelper.php.

Referenced by TYPO3\CMS\Fluid\ViewHelpers\Format\HtmlViewHelper\resetFrontendEnvironment().