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

Public Member Functions

 render ($value=null, $decimals=0, $decimalSeparator= '.', $thousandsSeparator= ',')
 
- 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)
 

Static Protected Attributes

static $units = array()
 

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 an integer with a byte count into human-readable form.

= Examples =

{fileSize -> f:format.bytes()} <output> 123 KB // depending on the value of {fileSize} </output>

{fileSize -> f:format.bytes(decimals: 2, decimalSeparator: ',', thousandsSeparator: ',')} <output> 1,023.00 B // depending on the value of {fileSize} </output>

Definition at line 43 of file BytesViewHelper.php.

Member Function Documentation

render (   $value = null,
  $decimals = 0,
  $decimalSeparator = '.',
  $thousandsSeparator = ',' 
)

Render the supplied byte count as a human readable string.

Parameters
int$valueThe incoming data to convert, or NULL if VH children should be used
int$decimalsThe number of digits after the decimal point
string$decimalSeparatorThe decimal point character
string$thousandsSeparatorThe character for grouping the thousand digits
Returns
string Formatted byte count

Definition at line 60 of file BytesViewHelper.php.

References AbstractViewHelper\buildRenderChildrenClosure().

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

Applies htmlspecialchars() on the specified value.

Parameters
array$arguments
\Closure$renderChildrenClosure
\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface$renderingContext
Returns
string

Definition at line 82 of file BytesViewHelper.php.

References AbstractViewHelper\$renderChildrenClosure, LocalizationUtility\translate(), and GeneralUtility\trimExplode().

Member Data Documentation

$units = array()
staticprotected

Definition at line 48 of file BytesViewHelper.php.