Format.case ViewHelper <f:format.case>
Note
This reference is part of the documentation of Fluid Standalone. If you are working with Fluid in TYPO3 CMS, please refer to TYPO3's ViewHelper reference instead.
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 lowercase Example: "Hello World" -> "hello world"
upper
- Transforms the input string to uppercase Example: "Hello World" -> "HELLO WORLD"
capital
- Transforms the first character of the input string to uppercase Example: "hello world" -> "Hello world"
uncapital
- Transforms the input string to its first letter lower-cased Example: "Hello World" -> "hello World"
capitalWords
- Transforms the input string to capitalize each word Example: "hello world" -> "Hello World"
Note that the behavior will be the same as in the appropriate PHP function mb_convert_case; especially regarding locale and multibyte behavior.
Examples
Default
<f:format.case>Some Text with miXed case</f:format.case>
Copied!
Output:
SOME TEXT WITH MIXED CASE
Copied!
Example with given mode
<f:format.case mode="capital">someString</f:format.case>
Copied!
Output:
SomeString
Copied!
Go to the source code of this ViewHelper: Format\CaseViewHelper.php (GitHub).
Arguments
The following arguments are available for the format.case ViewHelper:
mode
-
- Type
- string
- Default
- 'upper'
The case to apply, must be one of this' CASE_* constants. Defaults to uppercase application.
value
-
- Type
- string
The input value. If not given, the evaluated child nodes will be used.