StripTagsViewHelper extends AbstractViewHelper uses CompileWithContentArgumentAndRenderStatic
This class is the implementation of a Fluid ViewHelper.
View this class in the TYPO3 ViewHelper reference: <f:format.striptags>
Removes tags from the given string (applying PHPs :php:`strip_tags()` function) See https://www.php.net/manual/function.strip-tags.php.
Examples
Default notation
::
<f:format.stripTags>Some Text with Tags and an Ümlaut.</f:format.stripTags>
Some Text with Tags and an Ümlaut. :php:strip_tags()
applied.
.. note:: Encoded entities are not decoded.
Default notation with allowedTags
::
<f:format.stripTags allowedTags="
paragraph
spanOutput::
paragraph
spanInline notation
::
{text -> f:format.stripTags()}
Text without tags :php:strip_tags()
applied.
Inline notation with allowedTags
::
{text -> f:format.stripTags(allowedTags: "
Text with p, span, div and script Tags inside, all other tags are removed.
Table of Contents
Properties
- $escapeChildren : bool
- To ensure all tags are removed, child node's output must not be escaped
- $escapeOutput : bool
- No output escaping as some tags may be allowed
Methods
- initializeArguments() : mixed
- Initialize ViewHelper arguments
- renderStatic() : string
- Applies strip_tags() on the specified value.
Properties
$escapeChildren
To ensure all tags are removed, child node's output must not be escaped
protected
bool
$escapeChildren
= false
$escapeOutput
No output escaping as some tags may be allowed
protected
bool
$escapeOutput
= false
Methods
initializeArguments()
Initialize ViewHelper arguments
public
initializeArguments() : mixed
Tags
renderStatic()
Applies strip_tags() on the specified value.
public
static renderStatic(array<string|int, mixed> $arguments, Closure $renderChildrenClosure, RenderingContextInterface $renderingContext) : string
Parameters
- $arguments : array<string|int, mixed>
- $renderChildrenClosure : Closure
- $renderingContext : RenderingContextInterface