TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Fluid\ViewHelpers\Format\HtmlspecialcharsViewHelper Class Reference
Inheritance diagram for TYPO3\CMS\Fluid\ViewHelpers\Format\HtmlspecialcharsViewHelper:
TYPO3\CMS\Fluid\ViewHelpers\Format\AbstractEncodingViewHelper TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper Tx_Fluid_ViewHelpers_Format_HtmlspecialcharsViewHelper

Public Member Functions

 render ($value=NULL, $keepQuotes=FALSE, $encoding=NULL, $doubleEncode=TRUE)
 
 compile ($argumentsVariableName, $renderChildrenClosureVariableName, &$initializationPhpCode, \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode $syntaxTreeNode, \TYPO3\CMS\Fluid\Core\Compiler\TemplateCompiler $templateCompiler)
 
- Public Member Functions inherited from TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
 setArguments (array $arguments)
 
 setRenderingContext (\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
 
 injectReflectionService (\TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService)
 
 isEscapingInterceptorEnabled ()
 
 setViewHelperNode (\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode $node)
 
 setRenderChildrenClosure (\Closure $renderChildrenClosure)
 
 initializeArgumentsAndRender ()
 
 initialize ()
 
 renderChildren ()
 
 prepareArguments ()
 
 validateArguments ()
 
 initializeArguments ()
 
 compile ($argumentsVariableName, $renderChildrenClosureVariableName, &$initializationPhpCode, \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode $syntaxTreeNode, \TYPO3\CMS\Fluid\Core\Compiler\TemplateCompiler $templateCompiler)
 
 resetState ()
 

Protected Attributes

 $escapingInterceptorEnabled = FALSE
 
- Protected Attributes inherited from TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
 $arguments
 
 $templateVariableContainer
 
 $controllerContext
 
 $renderingContext
 
 $renderChildrenClosure = NULL
 
 $viewHelperVariableContainer
 
 $objectManager
 
 $escapingInterceptorEnabled = TRUE
 

Additional Inherited Members

- Static Public Member Functions inherited from TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
static renderStatic (array $arguments, \Closure $renderChildrenClosure, \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
 
- Static Public Member Functions inherited from TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface
static renderStatic (array $arguments, \Closure $renderChildrenClosure, \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
 
- Protected Member Functions inherited from TYPO3\CMS\Fluid\ViewHelpers\Format\AbstractEncodingViewHelper
 resolveDefaultEncoding ()
 
- Protected Member Functions inherited from TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
 registerArgument ($name, $type, $description, $required=FALSE, $defaultValue=NULL)
 
 overrideArgument ($name, $type, $description, $required=FALSE, $defaultValue=NULL)
 
 callRenderMethod ()
 
 buildRenderChildrenClosure ()
 
 hasArgument ($argumentName)
 
- Static Protected Attributes inherited from TYPO3\CMS\Fluid\ViewHelpers\Format\AbstractEncodingViewHelper
static $defaultEncoding = NULL
 

Detailed Description

Applies htmlspecialchars() escaping to a value

See also
http://www.php.net/manual/function.htmlspecialchars.php

= Examples =

<f:format.htmlspecialchars>{text}</f:format.htmlspecialchars> <output> Text with & " ' < > * replaced by HTML entities (htmlspecialchars applied). </output>

{text -> f:format.htmlspecialchars(encoding: 'ISO-8859-1')} <output> Text with & " ' < > * replaced by HTML entities (htmlspecialchars applied). </output>

Definition at line 36 of file HtmlspecialcharsViewHelper.php.

Member Function Documentation

◆ compile()

TYPO3\CMS\Fluid\ViewHelpers\Format\HtmlspecialcharsViewHelper::compile (   $argumentsVariableName,
  $renderChildrenClosureVariableName,
$initializationPhpCode,
\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode  $syntaxTreeNode,
\TYPO3\CMS\Fluid\Core\Compiler\TemplateCompiler  $templateCompiler 
)
Parameters
string$argumentsVariableName
string$renderChildrenClosureVariableName
string$initializationPhpCode
\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode$syntaxTreeNode
\TYPO3\CMS\Fluid\Core\Compiler\TemplateCompiler$templateCompiler
Returns
string

Implements TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface.

Definition at line 79 of file HtmlspecialcharsViewHelper.php.

◆ render()

TYPO3\CMS\Fluid\ViewHelpers\Format\HtmlspecialcharsViewHelper::render (   $value = NULL,
  $keepQuotes = FALSE,
  $encoding = NULL,
  $doubleEncode = TRUE 
)

Escapes special characters with their escaped counterparts as needed using PHPs htmlspecialchars() function.

Parameters
string$valuestring to format
boolean$keepQuotesif TRUE, single and double quotes won't be replaced (sets ENT_NOQUOTES flag)
string$encoding
boolean$doubleEncodeIf FALSE existing html entities won't be encoded, the default is to convert everything.
Returns
string the altered string
See also
http://www.php.net/manual/function.htmlspecialchars.php

Definition at line 57 of file HtmlspecialcharsViewHelper.php.

References TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper\renderChildren(), and TYPO3\CMS\Fluid\ViewHelpers\Format\AbstractEncodingViewHelper\resolveDefaultEncoding().

Member Data Documentation

◆ $escapingInterceptorEnabled

TYPO3\CMS\Fluid\ViewHelpers\Format\HtmlspecialcharsViewHelper::$escapingInterceptorEnabled = FALSE
protected

Definition at line 44 of file HtmlspecialcharsViewHelper.php.