Format.stripTags ViewHelper <f:format.stripTags>
Note
This reference is part of the documentation of Fluid Standalone. If you are working with Fluid in TYPO3 CMS, please refer to TYPO3's ViewHelper reference instead.
Removes tags from the given string (applying PHPs strip_
function)
See https://www.php.net/manual/function.strip-tags.php.
Examples
Default notation
<f:format.stripTags>Some Text with <b>Tags</b> and an Ümlaut.</f:format.stripTags>
Copied!
Some Text with Tags and an Ümlaut. strip_
applied.
Note
Encoded entities are not decoded.
Default notation with allowedTags
<f:format.stripTags allowedTags="<p><span><div><script>">
<p>paragraph</p><span>span</span><div>divider</div><iframe>iframe</iframe><script>script</script>
</f:format.stripTags>
Copied!
Output:
<p>paragraph</p><span>span</span><div>divider</div>iframe<script>script</script>
Copied!
Inline notation
{text -> f:format.stripTags()}
Copied!
Text without tags strip_
applied.
Inline notation with allowedTags
{text -> f:format.stripTags(allowedTags: "<p><span><div><script>")}
Copied!
Text with p, span, div and script Tags inside, all other tags are removed.
Go to the source code of this ViewHelper: Format\StripTagsViewHelper.php (GitHub).
Arguments
The following arguments are available for the format.stripTags ViewHelper:
allowedTags
-
- Type
- string
Optional string of allowed tags as required by PHPs strip_tags() function
value
-
- Type
- string
string to format