TrimViewHelper extends AbstractViewHelper uses CompileWithRenderStatic

ViewHelper

This class is the implementation of a Fluid ViewHelper.

View this class in the TYPO3 ViewHelper reference: <f:format.trim>

FinalYes

This ViewHelper strips whitespace (or other characters) from the beginning and end of a string.

Possible sides are:

both (default) Strip whitespace (or other characters) from the beginning and end of a string

left or start Strip whitespace (or other characters) from the beginning of a string

right or end Strip whitespace (or other characters) from the end of a string

Examples

Defaults

::

#<f:format.trim> String to be trimmed. </f:format.trim>#

.. code-block:: text

#String to be trimmed.#

Trim only one side

::

#<f:format.trim side="right"> String to be trimmed. </f:format.trim>#

.. code-block:: text

String to be trimmed.#

Trim special characters

::

#<f:format.trim characters=" St."> String to be trimmed. </f:format.trim>#

.. code-block:: text

#ring to be trimmed#

Table of Contents

Properties

$escapeChildren  : bool
Output is escaped already. We must not escape children, to avoid double encoding.

Methods

initializeArguments()  : void
renderStatic()  : string

Properties

$escapeChildren

Output is escaped already. We must not escape children, to avoid double encoding.

protected bool $escapeChildren = false

Methods

initializeArguments()

public initializeArguments() : void

renderStatic()

public static renderStatic(array<string|int, mixed> $arguments, Closure $renderChildrenClosure, RenderingContextInterface $renderingContext) : string
Parameters
$arguments : array<string|int, mixed>
$renderChildrenClosure : Closure
$renderingContext : RenderingContextInterface
Return values
string

the trimmed value


        
On this page

Search results