:octocat: examples cleanup

This commit is contained in:
smiley
2022-07-09 18:10:23 +02:00
parent 9d309e2ff8
commit e971678ac5
17 changed files with 382 additions and 420 deletions
+11 -6
View File
@@ -1,6 +1,9 @@
<?php
namespace chillerlan\QRCodeExamples;
/**
* @created 03.06.2020
* @author Maximilian Kresse
* @license MIT
*/
use chillerlan\QRCode\{QRCode, QROptions};
use chillerlan\QRCode\Data\QRMatrix;
@@ -8,8 +11,6 @@ use chillerlan\QRCode\Common\EccLevel;
require_once __DIR__ . '/../vendor/autoload.php';
$data = 'https://www.youtube.com/watch?v=DLzxrzFCyOs&t=43s';
$options = new QROptions([
'version' => 7,
'outputType' => QRCode::OUTPUT_FPDF,
@@ -44,6 +45,10 @@ $options = new QROptions([
],
]);
\header('Content-type: application/pdf');
if(php_sapi_name() !== 'cli'){
header('Content-type: application/pdf');
}
echo (new QRCode($options))->render($data);
echo (new QRCode($options))->render('https://www.youtube.com/watch?v=dQw4w9WgXcQ');
exit;