2017 © Pedro Peláez
 

symfony-bundle barcode-bundle

Barcode generation bundle wrapping Zend barcode component.

image

markup/barcode-bundle

Barcode generation bundle wrapping Zend barcode component.

  • Monday, February 19, 2018
  • by shieldo
  • Repository
  • 3 Watchers
  • 2 Stars
  • 36,089 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 7 Versions
  • 13 % Grown

The README.md

MarkupBarcodeBundle

Build Status, (*1)

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., (*2)

Installation

Add MarkupBarcodeBundle to your composer.json:, (*3)

{
    "require": {
        "markup/barcode-bundle": "@dev"
    }
}

Add MarkupBarcodeBundle to your AppKernel.php:, (*4)

    public function registerBundles()
    {
        $bundles = [
            ...
            new Markup\BarcodeBundle\MarkupBarcodeBundle(),
        ];
        ...
    }

Finally, install the bundle using Composer:, (*5)

$ 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., (*6)

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)., (*7)

You can achieve this by declaring the definition in the bundle's semantic configuration:, (*8)

    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:, (*9)

    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:, (*10)

html+jinja <img src="{{ barcode_text_you_are_encoding|markup_barcode_data_uri('invoice') }}">, (*11)

License

Released under the MIT License. See LICENSE., (*12)

The Versions

19/02 2018

dev-master

9999999-dev

Barcode generation bundle wrapping Zend barcode component.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Douglas Greenshields

barcode

19/02 2018

dev-test_against_php_7_2

dev-test_against_php_7_2

Barcode generation bundle wrapping Zend barcode component.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Douglas Greenshields

barcode

31/03 2017

2.0.1

2.0.1.0

Barcode generation bundle wrapping Zend barcode component.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Douglas Greenshields

barcode

16/11 2016

2.0.0

2.0.0.0

Barcode generation bundle wrapping Zend barcode component.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Douglas Greenshields

barcode

28/01 2016

1.1.1

1.1.1.0

Barcode generation bundle wrapping Zend barcode component.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Douglas Greenshields

barcode

20/08 2014

1.1.0

1.1.0.0

Barcode generation bundle wrapping Zend barcode component.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Douglas Greenshields

barcode

25/09 2013

1.0

1.0.0.0

Barcode generation bundle wrapping Zend barcode component.

  Sources   Download

MIT

The Requires

 

by Douglas Greenshields

barcode