PHPackages                             mopa-liip/barcode-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. mopa-liip/barcode-bundle

ActiveSymfony-bundle[Templating &amp; Views](/categories/templating)

mopa-liip/barcode-bundle
========================

Integrates Zend\_Barcode and PHP QR Lib to be easily used in symfony2 via twig

1.1.6(10y ago)15.0kPHPPHP &gt;=5.3.2

Since Apr 25Pushed 10y ago1 watchersCompare

[ Source](https://github.com/FlameStorm/MopaBarcodeBundle)[ Packagist](https://packagist.org/packages/mopa-liip/barcode-bundle)[ Docs](https://github.com/FlameStorm/MopaBarcodeBundle)[ RSS](/packages/mopa-liip-barcode-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (7)Versions (7)Used By (0)

README
======

[](#readme)

Introduction
------------

[](#introduction)

MopaBarcodeBundle integrates Zend\_Barcode and PHP QR Lib to be easily used in symfony2 via twig. I did include phpqrcode form  due to changes in its config. Is just a shot and shouldnt be considered to be perfect. Feel free to fork and PR.

Prerequisites
-------------

[](#prerequisites)

Installation
------------

[](#installation)

1. Add this bundle to your composer.json:

```
{
    "require": {
        // ...
        "mopa-liip/barcode-bundle": "*",
        "liip/imagine-bundle": "*", // handles image installation via requirements
        // if you want to use the zend barcodes
        "zendframework/zend-barcode": "~2.3.7",
        "zendframework/zend-servicemanager": "~2.3.7",
        // optionally for playground
        "mopa/bootstrap-sandbox-bundle": "dev-master"
        // also read the readme:
        // https://github.com/phiamo/MopaBootstrapSandboxBundle
    }
}

```

2. Add this bundle to your app/AppKernel.php:

```
// application/ApplicationKernel.php
public function registerBundles()
{
    return array(
        // ...
        new Liip\ImagineBundle\LiipImagineBundle(),
        new Mopa\Bundle\BarcodeBundle\MopaBarcodeBundle(),
    );
}
```

Demo
----

[](#demo)

Include MopaBoostrapBundle in your app:

Include this snipplet in your routing.yml

```
my_barcode_playground:
    resource: "@MopaBarcodeBundle/Resources/config/routing/barcode_playground.yml"
    prefix:   /
```

Add this to your config.yml:

```
imports:
    - { resource: @MopaBootstrapSandboxBundle/Resources/config/examples/example_menu.yml }
    - { resource: @MopaBootstrapSandboxBundle/Resources/config/examples/example_navbar.yml }
```

And try http://{yoursymfonyapp}/mopa/barcode/playground

Usage
-----

[](#usage)

Have a look into the to see it in action

Supported Barcode Types depend on your Zend2 installation

If you installed it have a look into The Type given to the service is either the int or the string defined in the types arrays keys and values

To get the service in your controllers etc you can use

$bmanager = $this-&gt;container-&gt;get('mopa\_barcode.barcode\_service');

$bmanager-&gt;saveAs($type, $text, $file); to save a Barcode of $type with $text as $file or

$bmanager-&gt;get($type, $enctext, $absolute = false); to get the url to the file where $enctext is urlencoded and $absolute is an boolean to get either the absolute or the relative path (default)

Twig Helper
-----------

[](#twig-helper)

There is also a twig helper registered:

```

```

Of course the dict (3rd parameter is optional) have a look into to see what options can be set.

the dict also takes a noCache boolean, i wont explain it further

Using the bundle directly
-------------------------

[](#using-the-bundle-directly)

To Make usage e.g. of the Playground in your app, just copy the playground.html.twig to app/Resources/MopaBootstrapBundle/views/Barcode/playground.html.twig and modify as you like

Using the Bundle as a urlservice
--------------------------------

[](#using-the-bundle-as-a-urlservice)

If you would like to generate the barcodes on the fly include in your routing.yml

```
my_barcode_display:
    resource: "@MopaBarcodeBundle/Resources/config/routing/barcode_display.yml"
    prefix:   /
```

And just use Urls to generate your barcodes:

http://{yoursymfonyapp}/mopa/barcode/send/{type}/{enctext}

Using QR code overlays
----------------------

[](#using-qr-code-overlays)

Add this to twig template.

```

```

### Changing overlay images

[](#changing-overlay-images)

Add and edit this to your parameters.yml file.

```
mopa_barcode.overlay_images_path: Resources/qr_overlays

```

For each QR code level (size) you have to generate overlay image. Look in `Resources/qr\_overlays' path of bundle for example overlay images.

TODO
----

[](#todo)

```
- Load the different Barcode Libs in a different way. should't be done by ints :(

```

Known Issues
------------

[](#known-issues)

```
- Nothing what could not be done in another way, probably some will arise as soon as its published
  So make issues!
- There are probably things missing, so make PR's

```

###  Health Score

32

—

LowBetter than 71% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 73.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

6

Last Release

3662d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ed8192e247d168cfe40ba5286638ab923d6065c6db8beae4c1fa7971014a9104?d=identicon)[FlameStorm](/maintainers/FlameStorm)

---

Top Contributors

[![phiamo](https://avatars.githubusercontent.com/u/207291?v=4)](https://github.com/phiamo "phiamo (98 commits)")[![FlameStorm](https://avatars.githubusercontent.com/u/1779603?v=4)](https://github.com/FlameStorm "FlameStorm (10 commits)")[![szymek](https://avatars.githubusercontent.com/u/639609?v=4)](https://github.com/szymek "szymek (6 commits)")[![Pentium133](https://avatars.githubusercontent.com/u/373158?v=4)](https://github.com/Pentium133 "Pentium133 (4 commits)")[![garciaf](https://avatars.githubusercontent.com/u/900047?v=4)](https://github.com/garciaf "garciaf (4 commits)")[![matejvelikonja](https://avatars.githubusercontent.com/u/1881087?v=4)](https://github.com/matejvelikonja "matejvelikonja (3 commits)")[![EricReiche](https://avatars.githubusercontent.com/u/894987?v=4)](https://github.com/EricReiche "EricReiche (2 commits)")[![jcrombez](https://avatars.githubusercontent.com/u/777666?v=4)](https://github.com/jcrombez "jcrombez (2 commits)")[![WouterSioen](https://avatars.githubusercontent.com/u/1398405?v=4)](https://github.com/WouterSioen "WouterSioen (1 commits)")[![hidenorigoto](https://avatars.githubusercontent.com/u/89830?v=4)](https://github.com/hidenorigoto "hidenorigoto (1 commits)")[![neoshadybeat](https://avatars.githubusercontent.com/u/350521?v=4)](https://github.com/neoshadybeat "neoshadybeat (1 commits)")[![pachay](https://avatars.githubusercontent.com/u/98100?v=4)](https://github.com/pachay "pachay (1 commits)")

---

Tags

qr codetwigzendbarcode

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mopa-liip-barcode-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/mopa-liip-barcode-bundle/health.svg)](https://phpackages.com/packages/mopa-liip-barcode-bundle)
```

###  Alternatives

[twig/extra-bundle

A Symfony bundle for extra Twig extensions

91292.0M313](/packages/twig-extra-bundle)[yellowskies/qr-code-bundle

Symfony Barcode &amp; QR Code Generator Bundle with Twig extension

36682.9k](/packages/yellowskies-qr-code-bundle)[symfony/ux-icons

Renders local and remote SVG icons in your Twig templates.

545.8M69](/packages/symfony-ux-icons)[symfony/ux-toolkit

A tool to easily create a design system in your Symfony app with customizable, well-crafted Twig components

1432.0k](/packages/symfony-ux-toolkit)[boekkooi/jquery-validation-bundle

Jquery form validation bundle for symfony 2

2773.9k1](/packages/boekkooi-jquery-validation-bundle)[zenstruck/twig-service-bundle

Make functions, static methods, Symfony service methods available in your twig templates.

1310.1k](/packages/zenstruck-twig-service-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
