CaseViewHelper extends AbstractViewHelper uses CompileWithRenderStatic
This class is the implementation of a Fluid ViewHelper.
View this class in the TYPO3 ViewHelper reference: <f:format.case>
Modifies the case of an input string to upper- or lowercase or capitalization.
The default transformation will be uppercase as in mb_convert_case
_.
Possible modes are:
lower
Transforms the input string to its lowercase representation
upper
Transforms the input string to its uppercase representation
capital
Transforms the input string to its first letter upper-cased, i.e. capitalization
uncapital
Transforms the input string to its first letter lower-cased, i.e. uncapitalization
capitalWords
Transforms the input string to each containing word being capitalized
Note that the behavior will be the same as in the appropriate PHP function mb_convert_case
_;
especially regarding locale and multibyte behavior.
.. _mb_convert_case: https://www.php.net/manual/function.mb-convert-case.php
Examples
Default
::
<f:format.case>Some Text with miXed case</f:format.case>
Output::
SOME TEXT WITH MIXED CASE
Example with given mode
::
<f:format.case mode="capital">someString</f:format.case>
Output::
SomeString
Table of Contents
Constants
- CASE_CAPITAL = 'capital'
- Directs the input string being converted to "Capital case"
- CASE_CAPITAL_WORDS = 'capitalWords'
- Directs the input string being converted to "Capital Case For Each Word"
- CASE_LOWER = 'lower'
- Directs the input string being converted to "lowercase"
- CASE_UNCAPITAL = 'uncapital'
- Directs the input string being converted to "unCapital case"
- CASE_UPPER = 'upper'
- Directs the input string being converted to "UPPERCASE"
Properties
- $escapeChildren : bool
- Output is escaped already. We must not escape children, to avoid double encoding.
Methods
- initializeArguments() : void
- renderStatic() : string
- Changes the case of the input string
Constants
CASE_CAPITAL
Directs the input string being converted to "Capital case"
public
mixed
CASE_CAPITAL
= 'capital'
CASE_CAPITAL_WORDS
Directs the input string being converted to "Capital Case For Each Word"
public
mixed
CASE_CAPITAL_WORDS
= 'capitalWords'
CASE_LOWER
Directs the input string being converted to "lowercase"
public
mixed
CASE_LOWER
= 'lower'
CASE_UNCAPITAL
Directs the input string being converted to "unCapital case"
public
mixed
CASE_UNCAPITAL
= 'uncapital'
CASE_UPPER
Directs the input string being converted to "UPPERCASE"
public
mixed
CASE_UPPER
= 'upper'
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()
Changes the case of the input string
public
static renderStatic(array<string|int, mixed> $arguments, Closure $renderChildrenClosure, RenderingContextInterface $renderingContext) : string
Parameters
- $arguments : array<string|int, mixed>
- $renderChildrenClosure : Closure
- $renderingContext : RenderingContextInterface