gigablah / silex-qrcode
Silex QR Code Provider
Installs: 1 254
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 2
Forks: 1
Open Issues: 0
Requires
- endroid/qrcode: ~1.1
This package is auto-updated.
Last update: 2024-10-24 04:46:56 UTC
README
The QrCodeServiceProvider integrates the endroid/qrcode library with your Silex application.
Installation
Use Composer to install the gigablah/silex-qrcode library by adding it to your composer.json
.
{ "require": { "silex/silex": "~1.0", "gigablah/silex-qrcode": "~0.0.1" } }
Usage
Just register the service provider and optionally pass in some defaults.
$app->register(new Gigablah\Silex\QrCode\QrCodeServiceProvider(), array( 'qrcode.options' => array( 'size' => 300, 'padding' => 10 ) ));
You may now generate QR code images as follows:
$app['qrcode']->setText('http://example.org'); return new Symfony\Component\HttpFoundation\Response( $app['qrcode']->get('png'), 200, array('Content-Type' => 'image/png') );
Todo
- Wrap the
QrCode
class to provide a fluent interface
License
Released under the MIT license. See the LICENSE file for details.