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

Public Member Functions

 initializeArguments ()
 

Static Public Member Functions

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

Public Attributes

const CASE_LOWER = 'lower'
 
const CASE_UPPER = 'upper'
 
const CASE_CAPITAL = 'capital'
 
const CASE_UNCAPITAL = 'uncapital'
 
const CASE_CAPITAL_WORDS = 'capitalWords'
 

Protected Attributes

bool $escapeChildren = false
 

Detailed Description

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 Not supported yet: 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

Definition at line 74 of file CaseViewHelper.php.

Member Function Documentation

◆ initializeArguments()

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

Initialize ViewHelper arguments

Definition at line 111 of file CaseViewHelper.php.

◆ renderStatic()

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

Changes the case of the input string

Parameters
array$arguments
\Closure$renderChildrenClosure
RenderingContextInterface$renderingContext
Returns
‪string
Exceptions
Exception

Definition at line 126 of file CaseViewHelper.php.

References $output, TYPO3\CMS\Fluid\ViewHelpers\Format\CaseViewHelper\CASE_CAPITAL, TYPO3\CMS\Fluid\ViewHelpers\Format\CaseViewHelper\CASE_CAPITAL_WORDS, TYPO3\CMS\Fluid\ViewHelpers\Format\CaseViewHelper\CASE_LOWER, TYPO3\CMS\Fluid\ViewHelpers\Format\CaseViewHelper\CASE_UNCAPITAL, and TYPO3\CMS\Fluid\ViewHelpers\Format\CaseViewHelper\CASE_UPPER.

Member Data Documentation

◆ $escapeChildren

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

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

Definition at line 106 of file CaseViewHelper.php.

◆ CASE_CAPITAL

const TYPO3\CMS\Fluid\ViewHelpers\Format\CaseViewHelper::CASE_CAPITAL = 'capital'

◆ CASE_CAPITAL_WORDS

const TYPO3\CMS\Fluid\ViewHelpers\Format\CaseViewHelper::CASE_CAPITAL_WORDS = 'capitalWords'

Directs the input string being converted to "Capital Case For Each Word"

Definition at line 100 of file CaseViewHelper.php.

Referenced by TYPO3\CMS\Fluid\ViewHelpers\Format\CaseViewHelper\renderStatic().

◆ CASE_LOWER

const TYPO3\CMS\Fluid\ViewHelpers\Format\CaseViewHelper::CASE_LOWER = 'lower'

◆ CASE_UNCAPITAL

const TYPO3\CMS\Fluid\ViewHelpers\Format\CaseViewHelper::CASE_UNCAPITAL = 'uncapital'

◆ CASE_UPPER

const TYPO3\CMS\Fluid\ViewHelpers\Format\CaseViewHelper::CASE_UPPER = 'upper'