TYPO3  7.6
Public Member Functions | Static Public Member Functions | Public Attributes | Static Protected Attributes | List of all members
CaseViewHelper Class Reference
Inheritance diagram for CaseViewHelper:
AbstractViewHelper CompilableInterface

Public Member Functions

 render ($value=null, $mode=self::CASE_UPPER)
 
- Public Member Functions inherited from AbstractViewHelper
 setArguments (array $arguments)
 
 setRenderingContext (\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
 
 injectReflectionService (\TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService)
 
 isEscapingInterceptorEnabled ()
 
 setViewHelperNode (\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode $node)
 
 setRenderChildrenClosure (\Closure $renderChildrenClosure)
 
 initializeArgumentsAndRender ()
 
 initialize ()
 
 renderChildren ()
 
 prepareArguments ()
 
 validateArguments ()
 
 initializeArguments ()
 
 compile ($argumentsVariableName, $renderChildrenClosureVariableName, &$initializationPhpCode,\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode $syntaxTreeNode,\TYPO3\CMS\Fluid\Core\Compiler\TemplateCompiler $templateCompiler)
 
 resetState ()
 
- Public Member Functions inherited from CompilableInterface
 compile ($argumentsVariableName, $renderChildrenClosureVariableName, &$initializationPhpCode,\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode $syntaxTreeNode,\TYPO3\CMS\Fluid\Core\Compiler\TemplateCompiler $templateCompiler)
 

Static Public Member Functions

static renderStatic (array $arguments,\Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
 
- Static Public Member Functions inherited from AbstractViewHelper
static renderStatic (array $arguments,\Closure $renderChildrenClosure,\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
 
- Static Public Member Functions inherited from CompilableInterface
static renderStatic (array $arguments,\Closure $renderChildrenClosure,\TYPO3\CMS\Fluid\Core\Rendering\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'
 

Static Protected Attributes

static $charsetConverter = null
 

Additional Inherited Members

- Protected Member Functions inherited from AbstractViewHelper
 registerArgument ($name, $type, $description, $required=false, $defaultValue=null)
 
 overrideArgument ($name, $type, $description, $required=false, $defaultValue=null)
 
 callRenderMethod ()
 
 getLogger ()
 
 buildRenderChildrenClosure ()
 
 hasArgument ($argumentName)
 
- Protected Attributes inherited from AbstractViewHelper
 $arguments
 
 $templateVariableContainer
 
 $controllerContext
 
 $renderingContext
 
 $renderChildrenClosure = null
 
 $viewHelperVariableContainer
 
 $objectManager
 
 $escapingInterceptorEnabled = true
 

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 [1].

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 [1]; especially regarding locale and multibyte behavior.

See Also
http://php.net/manual/function.mb-convert-case.php [1]

= Examples =

<f:format.case>Some Text with miXed case</f:format.case> <output> SOME TEXT WITH MIXED CASE </output>

<f:format.case mode="capital">someString</f:format.case> <output> SomeString </output>

Definition at line 65 of file Format/CaseViewHelper.php.

Member Function Documentation

render (   $value = null,
  $mode = self::CASE_UPPER 
)

Changes the case of the input string

Parameters
string$valueThe input value. If not given, the evaluated child nodes will be used
string$modeThe case to apply, must be one of this' CASE_* constants. Defaults to uppercase application
Returns
string the altered string.

Definition at line 105 of file Format/CaseViewHelper.php.

References AbstractViewHelper\buildRenderChildrenClosure().

static 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
InvalidVariableException

Definition at line 126 of file Format/CaseViewHelper.php.

References CaseViewHelper\$charsetConverter, AbstractViewHelper\$renderChildrenClosure, and GeneralUtility\makeInstance().

Member Data Documentation

$charsetConverter = null
staticprotected

Definition at line 95 of file Format/CaseViewHelper.php.

Referenced by CaseViewHelper\renderStatic().

const CASE_CAPITAL = 'capital'

Directs the input string being converted to "Capital case"

Definition at line 80 of file Format/CaseViewHelper.php.

Referenced by CaseViewHelperTest\conversionTestingDataProvider().

const CASE_CAPITAL_WORDS = 'capitalWords'

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

Definition at line 90 of file Format/CaseViewHelper.php.

const CASE_LOWER = 'lower'

Directs the input string being converted to "lowercase"

Definition at line 70 of file Format/CaseViewHelper.php.

Referenced by CaseViewHelperTest\conversionTestingDataProvider().

const CASE_UNCAPITAL = 'uncapital'

Directs the input string being converted to "unCapital case"

Definition at line 85 of file Format/CaseViewHelper.php.

Referenced by CaseViewHelperTest\conversionTestingDataProvider().

const CASE_UPPER = 'upper'

Directs the input string being converted to "UPPERCASE"

Definition at line 75 of file Format/CaseViewHelper.php.

Referenced by CaseViewHelperTest\conversionTestingDataProvider().