priotas/twig-qrcode-extension

This package is abandoned and no longer maintained. No replacement package was suggested.

A Twig extension for embedding inline QR codes in Twig templates

v1 2017-09-20 09:19 UTC

This package is not auto-updated.

Last update: 2020-04-28 18:47:28 UTC


README

Build Status

Overview

  • A Twig extension for embedding inline QR codes in Twig templates.
  • The standard filter output is a DataURL string of the processed text.
composer require priotas/twig-qrcode-extension
<!-- index.html.twig -->
<!DOCTYPE html>
<html>
    <body>

        <img src="{{ 'http://kewl.example.com' | qrcode(size=200) }}" />
    
    </body>
</html>

use Priotas\Twig\Extension\QrCode;

$loader = new \Twig_Loader_Filesystem(__DIR__);
$twig = new \Twig_Environment($loader);
$twig->addExtension(new QrCode());

echo $twig->render('index.html.twig');

Available filter options

Option Type Default Description
type string png The image type. Available types are png,eps,svg
label string A label for the QR code
size integer 200 The size of the QR code
version integer auto The version of the QR code. Range 1-40
svg string data_uri How a SVG should be rendered. data_uri is a data:svg+xml blob. inline is an inline svg tag

Dependencies