ozznest/barcode-bundle 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

ozznest/barcode-bundle

最新稳定版本:3.1

Composer 安装命令:

composer require ozznest/barcode-bundle

包简介

Barcode generation bundle wrapping Zend barcode component.

关键字:

README 文档

README

Build Status

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.

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-06-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固