PHP Class eZ\Publish\Core\MVC\Symfony\Templating\Twig\Extension\FileSizeExtension

Inheritance: extends Twig_Extensio\Twig_Extension
ファイルを表示 Open project: ezsystems/ezpublish-kernel

Protected Properties

Property Type Description
$configResolver
$localeConverter
$suffixes
$translator

Public Methods

Method Description
__construct ( Symfony\Component\Translation\TranslatorInterface $translator, array $suffixes, eZ\Publish\Core\MVC\ConfigResolverInterface $configResolver, eZ\Publish\Core\MVC\Symfony\Locale\LocaleConverterInterface $localeConverter )
getFilters ( ) : array Returns a list of filters to add to the existing list.
getName ( ) : string Returns the name of the extension.
sizeFilter ( integer $number, integer $precision ) : string Returns the binary file size, $precision will determine the decimal number precision, and the Locale will alter the format of the result by choosing between coma or point pattern.

Private Methods

Method Description
getLocale ( )

Method Details

__construct() public method

public __construct ( Symfony\Component\Translation\TranslatorInterface $translator, array $suffixes, eZ\Publish\Core\MVC\ConfigResolverInterface $configResolver, eZ\Publish\Core\MVC\Symfony\Locale\LocaleConverterInterface $localeConverter )
$translator Symfony\Component\Translation\TranslatorInterface
$suffixes array
$configResolver eZ\Publish\Core\MVC\ConfigResolverInterface
$localeConverter eZ\Publish\Core\MVC\Symfony\Locale\LocaleConverterInterface

getFilters() public method

Returns a list of filters to add to the existing list.
public getFilters ( ) : array
return array An array of filters

getName() public method

Returns the name of the extension.
public getName ( ) : string
return string The extension name

sizeFilter() public method

Returns the binary file size, $precision will determine the decimal number precision, and the Locale will alter the format of the result by choosing between coma or point pattern.
public sizeFilter ( integer $number, integer $precision ) : string
$number integer
$precision integer
return string

Property Details

$configResolver protected_oe property

protected $configResolver

$localeConverter protected_oe property

protected $localeConverter

$suffixes protected_oe property

protected $suffixes

$translator protected_oe property

protected $translator