PHPackages                             yellowskies/qr-code-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. yellowskies/qr-code-bundle

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

yellowskies/qr-code-bundle
==========================

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

v2.0.3(3mo ago)36682.9k↑50.5%9[1 issues](https://github.com/AntoineTesson/QRcodeBundle/issues)Apache-2.0PHPPHP &gt;=8.2CI passing

Since Sep 30Pushed 3mo ago2 watchersCompare

[ Source](https://github.com/AntoineTesson/QRcodeBundle)[ Packagist](https://packagist.org/packages/yellowskies/qr-code-bundle)[ RSS](/packages/yellowskies-qr-code-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (6)Versions (20)Used By (0)

YellowskiesQRcodeBundle
=======================

[](#yellowskiesqrcodebundle)

[![Latest Stable Version](https://camo.githubusercontent.com/e35f3e0244de856e9b54913d7a4cadb39779a3317d9b6cfa985316900b5e5a52/68747470733a2f2f706f7365722e707567782e6f72672f79656c6c6f77736b6965732f71722d636f64652d62756e646c652f76657273696f6e)](https://packagist.org/packages/yellowskies/qr-code-bundle)[![License](https://camo.githubusercontent.com/7e138d70e88790e21c5370d712ebdad3305c973f2d84238d4485ccf47c0487a4/68747470733a2f2f706f7365722e707567782e6f72672f79656c6c6f77736b6965732f71722d636f64652d62756e646c652f6c6963656e7365)](https://packagist.org/packages/yellowskies/qr-code-bundle)

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

**Supports PHP 8.2+ and Symfony 6.4 / 7.x / 8.x**

Features
--------

[](#features)

- Support 3 two-dimensional (2D) and 30 one-dimensional (1D) Barcode types
- Three output formats: HTML, PNG and SVG
- Twig integration: use the `barcode` function directly in your templates
- No external dependencies for barcode generation

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

[](#installation)

```
composer require yellowskies/qr-code-bundle
```

The bundle uses Symfony Flex and will be automatically configured.

### Manual registration (if not using Flex)

[](#manual-registration-if-not-using-flex)

Add to `config/bundles.php`:

```
return [
    // ...
    Skies\QRcodeBundle\SkiesQRcodeBundle::class => ['all' => true],
];
```

Usage
-----

[](#usage)

### Generate options

[](#generate-options)

OptionTypeRequiredAllowed valuesDescriptioncodestringrequiredWhat you want to encodetypestringrequired[See types below](#supported-barcode-types)Type of barcodeformatstringrequiredhtml, svg, pngOutput formatwidthintoptionalWidth of unitheightintoptionalHeight of unitcolorstring/arrayoptionalHTML color / \[R,G,B\]Barcode color> Default width/height: 2D = 5x5, 1D = 2x30 Default color: html/svg = "black", png = \[0, 0, 0\]

### In Twig templates

[](#in-twig-templates)

```
{# HTML barcode #}
{{ barcode({code: 'Hello World', type: 'qrcode', format: 'html'}) }}

{# SVG with custom size and color #}
{{ barcode({code: 'Hello World', type: 'qrcode', format: 'svg', width: 10, height: 10, color: 'green'}) }}

{# PNG (base64 encoded) #}

```

### In a controller/service

[](#in-a-controllerservice)

```
use Skies\QRcodeBundle\Generator\Generator;

class MyController extends AbstractController
{
    public function index(Generator $generator): Response
    {
        $barcode = $generator->generate([
            'code'   => 'Hello World',
            'type'   => 'qrcode',
            'format' => 'svg',
            'width'  => 10,
            'height' => 10,
            'color'  => 'green',
        ]);

        return new Response($barcode);
    }
}
```

### Standalone usage

[](#standalone-usage)

```
use Skies\QRcodeBundle\Generator\Generator;

$generator = new Generator();
$barcode = $generator->generate([
    'code'   => 'Hello World',
    'type'   => 'qrcode',
    'format' => 'html',
]);
```

### Save to file

[](#save-to-file)

```
// HTML or SVG
file_put_contents('/tmp/barcode.svg', $barcode);

// PNG (decode base64 first)
file_put_contents('/tmp/barcode.png', base64_decode($barcode));
```

Supported Barcode Types
-----------------------

[](#supported-barcode-types)

### 2D Barcodes

[](#2d-barcodes)

TypeNameExampleqrcode[QR Code](https://en.wikipedia.org/wiki/QR_code)[![](Resources/doc/barcode/qrcode.png)](Resources/doc/barcode/qrcode.png)pdf417[PDF417](https://en.wikipedia.org/wiki/PDF417)[![](Resources/doc/barcode/pdf417.png)](Resources/doc/barcode/pdf417.png)datamatrix[Data Matrix](https://en.wikipedia.org/wiki/Data_Matrix)[![](Resources/doc/barcode/datamatrix.png)](Resources/doc/barcode/datamatrix.png)### 1D Barcodes

[](#1d-barcodes)

TypeNamec128[Code 128](https://en.wikipedia.org/wiki/Code_128)c128a/b/cCode 128 A/B/Cc39[Code 39](https://en.wikipedia.org/wiki/Code_39)c39+Code 39 with check digitc39eCode 39 Extendedc39e+Code 39 Extended with check digitc93[Code 93](https://en.wikipedia.org/wiki/Code_93)ean8[EAN-8](https://en.wikipedia.org/wiki/EAN-8)ean13[EAN-13](https://en.wikipedia.org/wiki/EAN-13)upca[UPC-A](https://en.wikipedia.org/wiki/Universal_Product_Code)upce[UPC-E](https://en.wikipedia.org/wiki/Universal_Product_Code)i25[Interleaved 2 of 5](https://en.wikipedia.org/wiki/Interleaved_2_of_5)s25Standard 2 of 5msi[MSI](https://en.wikipedia.org/wiki/MSI_Barcode)postnet[POSTNET](https://en.wikipedia.org/wiki/POSTNET)planet[PLANET](https://en.wikipedia.org/wiki/Postal_Alpha_Numeric_Encoding_Technique)rms4cc[RMS4CC](https://en.wikipedia.org/wiki/RM4SCC)kix[KIX-code](https://nl.wikipedia.org/wiki/KIX-code)imb[Intelligent Mail](https://en.wikipedia.org/wiki/Intelligent_Mail_barcode)codabar[Codabar](https://en.wikipedia.org/wiki/Codabar)code11[Code 11](https://en.wikipedia.org/wiki/Code_11)pharma[Pharmacode](https://en.wikipedia.org/wiki/Pharmacode)pharma2tPharmacode Two-TrackRequirements
------------

[](#requirements)

- PHP 8.2+
- Symfony 6.4+ / 7.x / 8.x
- GD extension (for PNG output)
- bcmath extension (for Intelligent Mail barcodes)

Upgrade from 1.x
----------------

[](#upgrade-from-1x)

If upgrading from version 1.x:

1. Update your `composer.json` to require `"yellowskies/qr-code-bundle": "^2.0"`
2. Ensure you're running PHP 8.2+ and Symfony 6.4+
3. The Twig function now returns the barcode string instead of echoing it (no change needed in templates)

License
-------

[](#license)

Apache-2.0

###  Health Score

61

—

FairBetter than 99% of packages

Maintenance79

Regular maintenance activity

Popularity49

Moderate usage in the ecosystem

Community11

Small or concentrated contributor base

Maturity84

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 100% 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 ~189 days

Recently: every ~75 days

Total

19

Last Release

106d ago

Major Versions

v0.0.1 → v1.2.02016-09-30

1.2.12 → v2.0.02026-02-01

PHP version history (5 changes)1.0.0PHP &gt;=5.5.9|^7.0

v1.2.4PHP &gt;=5.5.9|^7.1

1.2.5PHP &gt;=5.5.9

1.2.9PHP &gt;=7.1.3

v2.0.0PHP &gt;=8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/527ebafa7051d2eec88622fdc49182dd76b61f24e5fbedf73b419b224863f108?d=identicon)[AntoineTesson](/maintainers/AntoineTesson)

---

Top Contributors

[![AntoineTesson](https://avatars.githubusercontent.com/u/11756749?v=4)](https://github.com/AntoineTesson "AntoineTesson (5 commits)")

---

Tags

qr codeqrcodesymfonybundletwiggeneratorbarcodesymfony8symfony6symfony7

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/yellowskies-qr-code-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/yellowskies-qr-code-bundle/health.svg)](https://phpackages.com/packages/yellowskies-qr-code-bundle)
```

###  Alternatives

[twig/extra-bundle

A Symfony bundle for extra Twig extensions

91492.0M315](/packages/twig-extra-bundle)[nucleos/antispam-bundle

This bundle provides some basic features to reduce spam in symfony forms.

52105.1k](/packages/nucleos-antispam-bundle)

PHPackages © 2026

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