2017 © Pedro Peláez
 

fuel-package fuel-qrcode

Export QR code

image

fuelqr/fuel-qrcode

Export QR code

  • Friday, July 22, 2016
  • by Amethystos
  • Repository
  • 1 Watchers
  • 0 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

FuelPHP QRCode

QRCode library created as a FuelPHP package., (*1)

Usage

Load the QRCode package, (*2)

// load the package
\Package::load("qrcode");

Output the QR directly, used within a view (ugly), (*3)

echo \QRCode::png('http://arrggghhh.steadweb.co.uk');

or pass the generated QRCode to a view, (*4)


try
{
        $file   = time() . ".png";
        $qrcode = "";

        // generate the QRCode
        \QRCode::png('http://arrggghhh.steadweb.co.uk', $file, QR_ECLEVEL_L, 6, 4, false);

        // check the file has been generated
        // otherwise throw an exception
        if( ! is_file(DOCROOT . $file))
        {
                throw new Exception("Unable to generate QR code");
        }
        
        $qrcode = Asset::img(Uri::create("/" . $file))
}
catch(\Exception $e)
{
        // log the error
        Log::error($e->getMessage());
        
        // show something, atleast
        $qrcode = "QRCode wasn't generated, derp.";
}

return \View::forge("qrcode", array("qr" => $qrcode), false);

The Versions

22/07 2016

dev-master

9999999-dev https://github.com/steadweb/fuel-qrcode

Export QR code

  Sources   Download

MIT

The Requires

 

by Luke Steadman

qrcode qr