Developed with love by KnpLabs Hire us for your project!
0

EndroidQrCodeBundle

by edorfaus

QR Code Generation Bundle for use in Symfony

Endroid QR Code Bundle

By endroid

Build Status

This bundle provides a default controller for generating QR codes using the Endroid QR Code (endroid/QrCode) library. No
configuration or extension loading is required. You only need to load the routing file.

knpbundles.com

Requirements

  • Symfony
  • Dependencies:

Installation

Add in your composer.json

{
    "require": {
        "endroid/qrcode-bundle": "dev-master"
    }
}

Install the bundle

$ curl -s http://getcomposer.org/installer | php
$ php composer.phar update endroid/qrcode-bundle

Composer will install the bundle to your project's vendor/endroid directory.

Enable the bundle via the kernel

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Endroid\Bundle\QrCodeBundle\EndroidQrCodeBundle(),
    );
}

Routing

Add the following section to your routing to be able to reach the controller.

EndroidQrCodeBundle:
    resource:   "@EndroidQrCodeBundle/Controller/"
    type:       annotation
    prefix:     /qrcode

Twig extension

The bundle also provides a Twig extension for quickly generating QR code urls.

<img src="{{ qrcode_url(message) }}" />

Configuration

No configuration required.

Usage

After installation and configuration, QR codes can be generated by appending the QR code text to the url as mounted,
followed by .png, .jpg or .gif. For the example given above, this would be /qrcode/Life_is_too_short_to_be_generating_qr_codes.png.

License

This bundle is under the MIT license. For the full copyright and license information, please view the LICENSE file that
was distributed with this source code.

Copyright (c) 2013 Jeroen van den Enden

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.