承接 marioblazek/twig-byte-units-extension 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

marioblazek/twig-byte-units-extension

最新稳定版本:v1.1.0

Composer 安装命令:

composer require marioblazek/twig-byte-units-extension

包简介

Twig filters that format output of units of information by using ByteUnits library by Gabriele Lana

README 文档

README

Build Status Code Coverage Downloads Latest stable License

This package provides simple Twig filters that wrap ByteUnits lib by Gabriele Lana which makes manipulation with informational units very easy.

Installation

To install this extension, use Composer:

composer require marioblazek/twig-byte-units-extension 

Using the extension

In PHP:

$twig = new Twig_Environment($loader, $options); $twig->addExtension(new Marek\Twig\ByteUnitsExtension());

In a Symfony project, you can register the extension as a service:

services: twig.extension.byte_units: class: Marek\Twig\ByteUnitsExtension tags: - { name: twig.extension }

Once set up, you can use the following Twig filters:

  • 1322000|byte_units_format_metric('MB') - Returns value formated in MB as returned by ByteUnits\Metric::format method
  • 1322000|byte_units_format_binary('MB') - Returns value formated in MiB as returned by ByteUnits\Binary::format method
  • 1322000|byte_units_bytes_metric - Returns the number of bytes as string returned by ByteUnits\Metric::numberOfBytes method
  • 1322000|byte_units_bytes_binary - Returns the number of bytes as string returned by ByteUnits\Binary::numberOfBytes method

for more information please check formating section on byte-units repo.

统计信息

  • 总下载量: 18.37k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 1
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固