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

Public Member Functions

 initializeArguments ()
 

Static Public Member Functions

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

Protected Attributes

bool $escapeOutput = false
 

Detailed Description

Wrapper for PHPs :php:nl2br function. See https://www.php.net/manual/function.nl2br.php.

Examples

Default

::

<f:format.nl2br>{text_with_linebreaks}</f:format.nl2br>

Text with line breaks replaced by <br />

Inline notation

::

{text_with_linebreaks -> f:format.nl2br()}

Text with line breaks replaced by <br />

Definition at line 47 of file Nl2brViewHelper.php.

Member Function Documentation

◆ initializeArguments()

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

Initialize arguments.

Exceptions

Definition at line 59 of file Nl2brViewHelper.php.

◆ renderStatic()

static string TYPO3\CMS\Fluid\ViewHelpers\Format\Nl2brViewHelper::renderStatic ( array  $arguments,
\Closure  $renderChildrenClosure,
RenderingContextInterface  $renderingContext 
)
static

Applies nl2br() on the specified value.

Parameters
array$arguments
\Closure$renderChildrenClosure
\TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface$renderingContext
Returns
‪string

Definition at line 72 of file Nl2brViewHelper.php.

Member Data Documentation

◆ $escapeOutput

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

Definition at line 52 of file Nl2brViewHelper.php.