All Projects → endroid → Qr Code Bundle

endroid / Qr Code Bundle

Licence: mit
Bundle for generating QR codes in Symfony

Projects that are alternatives of or similar to Qr Code Bundle

Twig Bundle
The Twig Bundle provides configuration for using Twig in your applications.
Stars: ✭ 2,150 (+1172.19%)
Mutual labels:  bundle, twig, symfony
Web Profiler Bundle
The WebProfilerBundle provides detailed technical information about each request execution and displays it in both the web debug toolbar and the profiler.
Stars: ✭ 1,905 (+1027.22%)
Mutual labels:  bundle, twig, symfony
pix-payload-generator.net
Gerar payload para qrcode estático PIX. (Sistema de pagamento instantâneo do Brasil) Sem a necessidade de conexão com um PSP.
Stars: ✭ 23 (-86.39%)
Mutual labels:  code, qrcode, qr
Fmbbcodebundle
🔠 BBCode bundle for Symfony projects
Stars: ✭ 56 (-66.86%)
Mutual labels:  bundle, twig, symfony
Jsformvalidatorbundle
The Javascript validation for Symfony 2, 3 and 4 forms
Stars: ✭ 130 (-23.08%)
Mutual labels:  bundle, symfony
Jrqrcode
二维码生成库,把内容生成二维码,以base64编码的图片输出
Stars: ✭ 128 (-24.26%)
Mutual labels:  qr, qrcode
React Qr Svg
React component for rendering SVG QR codes
Stars: ✭ 134 (-20.71%)
Mutual labels:  qr, qrcode
Sonatanotificationbundle
Symfony SonataNotificationBundle
Stars: ✭ 136 (-19.53%)
Mutual labels:  bundle, symfony
Consolebundle
Commandline interface in browser for Symfony2
Stars: ✭ 138 (-18.34%)
Mutual labels:  bundle, symfony
Zxinglite
🔥 ZXing的精简版,优化扫码和生成二维码/条形码,内置闪光灯等功能。扫描风格支持:微信的线条样式,支付宝的网格样式。几句代码轻松拥有扫码功能 ,ZXingLite让集成更简单。(扫码识别速度快如微信)
Stars: ✭ 2,117 (+1152.66%)
Mutual labels:  qrcode, code
Debug Bundle
The DebugBundle allows greater integration of the VarDumper component in the Symfony full-stack framework.
Stars: ✭ 2,033 (+1102.96%)
Mutual labels:  bundle, symfony
Webpack Bundle
Bundle to Integrate Webpack into Symfony
Stars: ✭ 124 (-26.63%)
Mutual labels:  bundle, symfony
Passwordstrengthbundle
Symfony Password strength and blacklisting validator bundle
Stars: ✭ 123 (-27.22%)
Mutual labels:  bundle, symfony
Qrscanner
A simple QR Code scanner framework for iOS. Provides a similar scan effect to ios13.
Stars: ✭ 134 (-20.71%)
Mutual labels:  qr, qrcode
Symfony Demo App
A Symfony demo application with basic user management
Stars: ✭ 122 (-27.81%)
Mutual labels:  twig, symfony
Swiftmailer Bundle
Symfony Swiftmailer Bundle
Stars: ✭ 1,558 (+821.89%)
Mutual labels:  bundle, symfony
Craueconfigbundle
Database-stored settings made available via a service for your Symfony project.
Stars: ✭ 154 (-8.88%)
Mutual labels:  bundle, symfony
Security Bundle
The security system is one of the most powerful parts of Symfony and can largely be controlled via its configuration.
Stars: ✭ 2,105 (+1145.56%)
Mutual labels:  bundle, symfony
Flagception Bundle
Feature flags on steroids!
Stars: ✭ 162 (-4.14%)
Mutual labels:  bundle, symfony
Nelmiocorsbundle
The NelmioCorsBundle allows you to send Cross-Origin Resource Sharing headers with ACL-style per-URL configuration.
Stars: ✭ 1,615 (+855.62%)
Mutual labels:  bundle, symfony

QR Code Bundle

By endroid

Latest Stable Version Build Status Total Downloads Monthly Downloads License

This Symfony lets you generate QR Codes using the endroid/qr-code library. It provides the following features.

  • Configure your defaults (like image size, default writer etc.)
  • Support for multiple configurations and injection via aliases
  • Generate QR codes for defined configurations via URL like /qr-code//Hello
  • Generate QR codes or URLs directly from Twig using dedicated functions

Installation

Use Composer to install the library.

$ composer require endroid/qr-code-bundle

When you use Symfony, the installer makes sure that services are automatically wired. If this is not the case you can find the configuration files in the .install/symfony folder.

Configuration

The bundle makes use of builders to create QR codes. The default parameters applied by the builder can optionally be overridden via the configuration. and multiple configurations (thus builders) can be defined.

endroid_qr_code:
    default:
        writer: Endroid\QrCode\Writer\PngWriter
        data: 'This is customized QR code'
        labelText: 'This is the label'
    custom:
        writer: Endroid\QrCode\Writer\SvgWriter
        writerOptions: []
        data: 'This is customized QR code'
        size: 300
        encoding: 'UTF-8'
        errorCorrectionLevel: 'high'
        roundBlockSizeMode: 'margin'
        logoPath: '%kernel.project_dir%/vendor/endroid/qr-code/tests/assets/symfony.png'
        logoResizeToWidth: 150
        labelText: 'This is the label'
        labelFontPath: '%kernel.project_dir%/vendor/endroid/qr-code/assets/noto_sans.otf'
        labelFontSize: 20
        labelAlignment: 'center'
        validateResult: false

Using builders

Each configuration results in a builder which can be injected in your classes. For instance the custom builder from the example above can be injected like this and you can override the default configuration as follows.

use Endroid\QrCode\Builder\BuilderInterface;

public function __construct(BuilderInterface $customQrCodeBuilder)
{
    $result = $customQrCodeBuilder
        ->size(400)
        ->margin(20)
        ->build();
}

QR Code Response

The bundle also provides a response object to ease rendering of the resulting image by automatically saving to contents and setting the correct content type.

use Endroid\QrCodeBundle\Response\QrCodeResponse;

$response = new QrCodeResponse($result);

Generate via URL

The bundle provides a controller that allows you to generate QR codes simply by opening an URL like /qr-code/{builder}/{data}. You can configure the prefix in your routing file and pass any of the existing options via query string.

Generate via Twig

The bundle provides a Twig extension for generating a QR code URL, path or data URI. You can use the second argument to specify the builder to use.

<img src="{{ qr_code_path('My QR Code') }}" />
<img src="{{ qr_code_url('My QR Code') }}" />
<img src="{{ qr_code_data_uri('My QR Code') }}" />

{# You can specify the builder via the second parameter #}
<img src="{{ qr_code_data_uri('My QR Code', 'custom') }}" />

Versioning

Version numbers follow the MAJOR.MINOR.PATCH scheme. Backwards compatibility breaking changes will be kept to a minimum but be aware that these can occur. Lock your dependencies for production and test your code when upgrading.

License

This source code is subject to the MIT license bundled in the file LICENSE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].