spe / filesize-extension-bundle
Twig filter for human readable filesize
Installs: 399 133
Dependents: 3
Suggesters: 0
Security: 0
Stars: 11
Watchers: 2
Forks: 6
Open Issues: 4
Type:symfony-bundle
Requires
- php: >=7
- twig/twig: >=2
This package is not auto-updated.
Last update: 2024-11-03 11:51:43 UTC
README
Install
Symfony 4.x, 5.x
composer require "spe/filesize-extension-bundle" "~2.0.0"
Symfony 2.x, 3.x
composer require "spe/filesize-extension-bundle" "~1.0.0"
app/AppKernel.php:
$bundles = array( // ... new SPE\FilesizeExtensionBundle\SPEFilesizeExtensionBundle(), // ... );
Usage
{{ file.size|readable_filesize }} {# 123.45 KB #} {{ file.size|readable_filesize(0) }} {# 123 KB #} {{ file.size|readable_filesize(0, '') }} {# 123KB #}