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

Public Member Functions

 render ($currencySign= '', $decimalSeparator= ',', $thousandsSeparator= '.', $prependCurrency=false, $separateCurrency=true, $decimals=2)
 
- 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)
 

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

Formats a given float to a currency representation.

= Examples =

<f:format.currency>123.456</f:format.currency> <output> 123,46 </output>

<f:format.currency currencySign="$" decimalSeparator="." thousandsSeparator="," prependCurrency="TRUE" separateCurrency="FALSE" decimals="2">54321</f:format.currency> <output> $54,321.00 </output>

{someNumber -> f:format.currency(thousandsSeparator: ',', currencySign: '€')} <output> 54,321,00 € (depending on the value of {someNumber}) </output>

Definition at line 47 of file CurrencyViewHelper.php.

Member Function Documentation

render (   $currencySign = '',
  $decimalSeparator = ',',
  $thousandsSeparator = '.',
  $prependCurrency = false,
  $separateCurrency = true,
  $decimals = 2 
)
Parameters
string$currencySign(optional) The currency sign, eg $ or €.
string$decimalSeparator(optional) The separator for the decimal point.
string$thousandsSeparator(optional) The thousands separator.
bool$prependCurrency(optional) Select if the curreny sign should be prepended
bool$separateCurrency(optional) Separate the currency sign from the number by a single space, defaults to true due to backwards compatibility
int$decimals(optional) Set decimals places.
Returns
string the formatted amount.

Definition at line 59 of file CurrencyViewHelper.php.

References AbstractViewHelper\buildRenderChildrenClosure().

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

Definition at line 82 of file CurrencyViewHelper.php.

References AbstractViewHelper\$renderChildrenClosure.