TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
BytesViewHelper Class Reference
Inheritance diagram for BytesViewHelper:
AbstractViewHelper

Public Member Functions

 initializeArguments ()
 
- Public Member Functions inherited from AbstractViewHelper
 setRenderingContext (\TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
 
 injectObjectManager (\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager)
 
 injectReflectionService (\TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService)
 
 prepareArguments ()
 

Static Public Member Functions

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

Protected Attributes

 $escapeChildren = false
 
- Protected Attributes inherited from AbstractViewHelper
 $controllerContext
 
 $objectManager
 

Additional Inherited Members

- Protected Member Functions inherited from AbstractViewHelper
 callRenderMethod ()
 
 getLogger ()
 
 registerRenderMethodArguments ()
 

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>

You may provide an own set of units, like this: B,KB,MB,GB,TB,PB,EB,ZB,YB {fileSize -> f:format.bytes(units: '{f:translate(\'viewhelper.format.bytes.units\', \'fluid\')}' <output> 123 KB // depending on the value of {fileSize} </output>

Definition at line 55 of file BytesViewHelper.php.

Member Function Documentation

initializeArguments ( )

Initialize ViewHelper arguments

Returns
void

Definition at line 71 of file BytesViewHelper.php.

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

Render the supplied byte count as a human readable string.

Parameters
array$arguments
\Closure$renderChildrenClosure
\TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface$renderingContext
Returns
string Formatted byte count

Definition at line 90 of file BytesViewHelper.php.

References LocalizationUtility\translate(), and GeneralUtility\trimExplode().

Member Data Documentation

$escapeChildren = false
protected

Definition at line 64 of file BytesViewHelper.php.