‪TYPO3CMS  10.4
TYPO3\CMS\Fluid\ViewHelpers\Format\UrlencodeViewHelper Class Reference
Inheritance diagram for TYPO3\CMS\Fluid\ViewHelpers\Format\UrlencodeViewHelper:

Public Member Functions

 initializeArguments ()
 

Static Public Member Functions

static mixed renderStatic (array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
 

Protected Attributes

bool $escapeChildren = false
 

Detailed Description

Encodes the given string according to http://www.faqs.org/rfcs/rfc3986.html Applying PHPs :php:rawurlencode() function. See https://www.php.net/manual/function.rawurlencode.php.

.. note:: The output is not escaped. You may have to ensure proper escaping on your own.

Examples

Default notation

::

<f:format.rawurlencode>foo +%/</f:format.rawurlencode>

foo%20%40%2B%25%2F :php:rawurlencode() applied.

Inline notation

::

{text -> f:format.urlencode()}

Url encoded text :php:rawurlencode() applied.

Definition at line 52 of file UrlencodeViewHelper.php.

Member Function Documentation

◆ initializeArguments()

TYPO3\CMS\Fluid\ViewHelpers\Format\UrlencodeViewHelper::initializeArguments ( )

Initialize ViewHelper arguments

Exceptions
Exception

Definition at line 66 of file UrlencodeViewHelper.php.

◆ renderStatic()

static mixed TYPO3\CMS\Fluid\ViewHelpers\Format\UrlencodeViewHelper::renderStatic ( array  $arguments,
\Closure  $renderChildrenClosure,
RenderingContextInterface  $renderingContext 
)
static

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

See also
https://www.php.net/manual/function.rawurlencode.php
Parameters
array$arguments
\Closure$renderChildrenClosure
RenderingContextInterface$renderingContext
Returns
‪mixed

Definition at line 81 of file UrlencodeViewHelper.php.

Member Data Documentation

◆ $escapeChildren

bool TYPO3\CMS\Fluid\ViewHelpers\Format\UrlencodeViewHelper::$escapeChildren = false
protected

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

Definition at line 59 of file UrlencodeViewHelper.php.