From 94e30f9f75c3cfa89097d75596dd7676ba9dc44b Mon Sep 17 00:00:00 2001 From: smiley Date: Wed, 9 Dec 2015 21:44:16 +0100 Subject: [PATCH] updated HTML example --- examples/html.php | 47 ++++++++++++++++++++++++++++++++++------------- 1 file changed, 34 insertions(+), 13 deletions(-) diff --git a/examples/html.php b/examples/html.php index 2a6dfa631..b96db36be 100644 --- a/examples/html.php +++ b/examples/html.php @@ -2,34 +2,55 @@ require_once '../vendor/autoload.php'; -use codemasher\QRCode\QRCode; -use codemasher\QRCode\QRConst; +use chillerlan\QRCode\Output\QRString; +use chillerlan\QRCode\Output\QRStringOptions; +use chillerlan\QRCode\QRCode; +use chillerlan\QRCode\QRConst; +use chillerlan\QRCode\QROptions; + //--------------------------------------------------------- echo ''; -// google authenticator -$qr = new QRCode('otpauth://totp/test?secret=B3JX4VCVJDVNXNZ5&issuer=chillerlan.net', QRConst::ERROR_CORRECT_LEVEL_M); -echo $qr->printHTML(); +$qrStringOptions = new QRStringOptions; +$qrStringOptions->type = QRConst::OUTPUT_STRING_HTML; + +$qrOptions = new QROptions; +$qrOptions->typeNumber = QRConst::TYPE_05; +$qrOptions->errorCorrectLevel = QRConst::ERROR_CORRECT_LEVEL_M; +$qrOptions->output = new QRString($qrStringOptions); + +$qr = new QRCode('skype://callto:echo123', $qrOptions); + +echo '
'.$qr->output().'
';