ozznest/barcode-bundle
Composer 安装命令:
composer require ozznest/barcode-bundle
包简介
Barcode generation bundle wrapping Zend barcode component.
关键字:
README 文档
README
About
This Symfony bundle provides a means of generating barcodes using the Laminas barcode component and printing them inline using a data URI. It avoids problems with parts of the Laminas component that retain state and so allows isolated barcode generation in the same execution cycle.
Installation
Add MarkupBarcodeBundle to your composer.json:
{ "require": { "markup/barcode-bundle": "@dev" } }
Add MarkupBarcodeBundle to your AppKernel.php:
public function registerBundles() { $bundles = [ ... new Markup\BarcodeBundle\MarkupBarcodeBundle(), ]; ... }
Finally, install the bundle using Composer:
$ php composer.phar update markup/barcode-bundle
Usage
The bundle works by allowing the declaration of named barcode definitions (specifying the spec being used for the barcode, the output format, etc). These definitions are then referred to when rendering an individual barcode.
Say you had a barcode you needed to generate for an "invoice" in your application. This invoice uses barcodes that were Code 128, and you want to use PNG as the image format for the barcode (PNG is, incidentally, the default).
You can achieve this by declaring the definition in the bundle's semantic configuration:
markup_barcode: definitions: invoice: type: code128 format: png
Alternatively, if you need more flexibility, you can write your own definition class that implements Markup\BarcodeBundle\Definition\DefinitionInterface and declare it as a service within your bundle, using a markup_barcode.definition tag with a declared alias:
my.barcode_definition: class: Me\MyBundle\Barcode\MyInvoiceBarcodeDefinition tags: - { name: markup_barcode.definition, alias: invoice }
Then, within a Twig template, you would use the following Twig filter (markup_barcode_data_uri) to generate a barcode from the text you are encoding:
<img src="{{ barcode_text_you_are_encoding|markup_barcode_data_uri('invoice') }}">
License
Released under the MIT License. See LICENSE.
ozznest/barcode-bundle 适用场景与选型建议
ozznest/barcode-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 4.52k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2021 年 06 月 14 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「barcode」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 ozznest/barcode-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 ozznest/barcode-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 ozznest/barcode-bundle 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Bundle providing a password encoder stack for support of legacy user data.
Symfony 4, 5, 6 ,7 Barcode Generator Bundle with Twig function extension
GS1 parser and generator for PHP
Symfony2 Barcode Generator Bundle with Twig function extension
PHP QR code decoder / reader
A library for EAN and ISBN name lookup and validation using the API on ean-search.org
统计信息
- 总下载量: 4.52k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 15
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-06-14