UrlencodeViewHelper extends AbstractViewHelper uses CompileWithContentArgumentAndRenderStatic

ViewHelper

This class is the implementation of a Fluid ViewHelper.

View this class in the TYPO3 ViewHelper reference: <f:format.urlencode>

FinalYes

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.urlencode>foo @+%/</f:format.urlencode>

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

Inline notation

::

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

Url encoded text :php:rawurlencode() applied.

Table of Contents

Properties

$escapeChildren  : bool
Output is escaped already. We must not escape children, to avoid double encoding.

Methods

initializeArguments()  : void
renderStatic()  : mixed
Escapes special characters with their escaped counterparts as needed using PHPs rawurlencode() function.
resolveContentArgumentName()  : string
Explicitly set argument name to be used as content.

Properties

$escapeChildren

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

protected bool $escapeChildren = false

Methods

initializeArguments()

public initializeArguments() : void

renderStatic()

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

public static renderStatic(array<string|int, mixed> $arguments, Closure $renderChildrenClosure, RenderingContextInterface $renderingContext) : mixed
Parameters
$arguments : array<string|int, mixed>
$renderChildrenClosure : Closure
$renderingContext : RenderingContextInterface
Tags
see
https://www.php.net/manual/function.rawurlencode.php

resolveContentArgumentName()

Explicitly set argument name to be used as content.

public resolveContentArgumentName() : string
Return values
string

        
On this page

Search results