PHPackages                             mopa/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. [Image &amp; Media](/categories/media)
4. /
5. mopa/barcode-bundle

ActiveSymfony-bundle[Image &amp; Media](/categories/media)

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

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

4169.5k↓21.4%25[5 issues](https://github.com/phiamo/MopaBarcodeBundle/issues)PHP

Since May 30Pushed 6y ago6 watchersCompare

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

READMEChangelogDependenciesVersions (1)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/barcode-bundle": "dev-master",
        "avalanche123/imagine-bundle": "dev-master", // 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 Avalanche\Bundle\ImagineBundle\AvalancheImagineBundle(),
        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

33

—

LowBetter than 75% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity43

Moderate usage in the ecosystem

Community23

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 79.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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/3a1fd1e7045090ca677014a06fee68bb9cfd75d4286bb8d9da181b7d1d0db032?d=identicon)[phiamo](/maintainers/phiamo)

---

Top Contributors

[![phiamo](https://avatars.githubusercontent.com/u/207291?v=4)](https://github.com/phiamo "phiamo (98 commits)")[![szymek](https://avatars.githubusercontent.com/u/639609?v=4)](https://github.com/szymek "szymek (6 commits)")[![garciaf](https://avatars.githubusercontent.com/u/900047?v=4)](https://github.com/garciaf "garciaf (4 commits)")[![Pentium133](https://avatars.githubusercontent.com/u/373158?v=4)](https://github.com/Pentium133 "Pentium133 (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)")

### Embed Badge

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

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

###  Alternatives

[milon/barcode

Barcode generator like Qr Code, PDF417, C39, C39+, C39E, C39E+, C93, S25, S25+, I25, I25+, C128, C128A, C128B, C128C, 2-Digits UPC-Based Extention, 5-Digits UPC-Based Extention, EAN 8, EAN 13, UPC-A, UPC-E, MSI (Variation of Plessey code)

1.5k13.3M39](/packages/milon-barcode)[bkwld/croppa

Image thumbnail creation through specially formatted URLs for Laravel

510496.0k23](/packages/bkwld-croppa)[goat1000/svggraph

Generates SVG graphs

132849.6k3](/packages/goat1000-svggraph)[cohensive/embed

Media Embed (for Laravel or as a standalone).

120370.4k](/packages/cohensive-embed)[netresearch/rte-ckeditor-image

Image support in CKEditor for the TYPO3 ecosystem - by Netresearch

63991.3k4](/packages/netresearch-rte-ckeditor-image)[humanmade/tachyon-plugin

Rewrites WordPress image URLs to use Tachyon

87338.5k2](/packages/humanmade-tachyon-plugin)

PHPackages © 2026

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