TYPO3  7.6
Public Member Functions | Protected Attributes | List of all members
HtmlspecialcharsViewHelper Class Reference
Inheritance diagram for HtmlspecialcharsViewHelper:
AbstractEncodingViewHelper CompilableInterface AbstractViewHelper

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 CompilableInterface
 compile ($argumentsVariableName, $renderChildrenClosureVariableName, &$initializationPhpCode,\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode $syntaxTreeNode,\TYPO3\CMS\Fluid\Core\Compiler\TemplateCompiler $templateCompiler)
 

Protected Attributes

 $escapingInterceptorEnabled = false
 

Additional Inherited Members

- Static Public Member Functions inherited from AbstractViewHelper
static renderStatic (array $arguments,\Closure $renderChildrenClosure,\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
 
- Static Public Member Functions inherited from CompilableInterface
static renderStatic (array $arguments,\Closure $renderChildrenClosure,\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
 
- Protected Member Functions inherited from AbstractViewHelper
 registerArgument ($name, $type, $description, $required=false, $defaultValue=null)
 
 overrideArgument ($name, $type, $description, $required=false, $defaultValue=null)
 
 callRenderMethod ()
 
 getLogger ()
 
 buildRenderChildrenClosure ()
 
 hasArgument ($argumentName)
 
- Static Protected Member Functions inherited from AbstractEncodingViewHelper
static resolveDefaultEncoding ()
 
- Static Protected Attributes inherited from 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 37 of file HtmlspecialcharsViewHelper.php.

Member Function Documentation

compile (   $argumentsVariableName,
  $renderChildrenClosureVariableName,
$initializationPhpCode,
\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode  $syntaxTreeNode,
\TYPO3\CMS\Fluid\Core\Compiler\TemplateCompiler  $templateCompiler 
)

This ViewHelper is used a lot because it is used by the escape interceptor. Therefore we render it to raw PHP code during compilation

Parameters
string$argumentsVariableName
string$renderChildrenClosureVariableName
string$initializationPhpCode
\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode$syntaxTreeNode
\TYPO3\CMS\Fluid\Core\Compiler\TemplateCompiler$templateCompiler
Returns
string

Definition at line 84 of file HtmlspecialcharsViewHelper.php.

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
bool$keepQuotesif TRUE, single and double quotes won't be replaced (sets ENT_NOQUOTES flag)
string$encoding
bool$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 58 of file HtmlspecialcharsViewHelper.php.

References AbstractViewHelper\renderChildren().

Member Data Documentation

$escapingInterceptorEnabled = false
protected

Definition at line 45 of file HtmlspecialcharsViewHelper.php.