1. Go to this page and download the library: Download bnomei/kirby3-qrcode library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
bnomei / kirby3-qrcode example snippets
$qrcodeObject = new \Bnomei\QRCode([
'Text' => 'https://github.com/bnomei/kirby3-qrcode',
]);
echo $qrcodeObject->html('qrcode-plugin.png');
// base64 encoded png image tag
// with $page->url() as Text
echo $page->qrcode()->html(
$page->slug() . '.png' // image format detected from extension
);
$qrcodeFilename = $page->slug() . '.png';
$file = $page->file($qrcodeFilename);
if (!$file) {
// short version
$file = $page->qrcode()->save(
$qrcodeFilename
);
// with all params
$file = $page->qrcode()->save(
$qrcodeFilename,
'myfiletemplate', // or null
[/* my content data array */],
true // force overwrite
);
}
echo $file; // outputs a img tag