SproutCMS

This is the code documentation for the SproutCMS project

source of /sprout/Helpers/QrCode.php

  1. <?php
  2. namespace Sprout\Helpers;
  3. require_once(__DIR__ . DIRECTORY_SEPARATOR . 'phpqrcode/qrlib.php');
  4.  
  5. use QRcode as QrCodeLib;
  6.  
  7.  
  8. class QrCode
  9. {
  10. /**
  11.   * Render QR code as PNG
  12.   *
  13.   * @param string $payload
  14.   * @return void Echos PNG directly
  15.   */
  16. public static function render($payload)
  17. {
  18. QrCodeLib::png($payload, false, 'H', 16, 2);
  19. }
  20. }
  21.