html-example.php 612 B

123456789101112131415161718192021
  1. <?php declare(strict_types=1);
  2. use Sprain\SwissQrBill as QrBill;
  3. require __DIR__ . '/../../vendor/autoload.php';
  4. // 1. Let's load the base example to define the qr bill contents
  5. require __DIR__ . '/../example.php';
  6. // 2. Create a full payment part in HTML
  7. $output = new QrBill\PaymentPart\Output\HtmlOutput\HtmlOutput($qrBill, 'en');
  8. $html = $output
  9. ->setPrintable(false)
  10. ->getPaymentPart();
  11. // 3. For demo purposes, let's save the generated example in a file
  12. $examplePath = __DIR__ . '/html-example.htm';
  13. file_put_contents($examplePath, $html);
  14. print 'HTML example created here: ' . $examplePath;