kuriousagency / qrcode
Generate a QR code
Installs: 8 132
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 2
Forks: 7
Open Issues: 3
Type:craft-plugin
Requires
- php: ^8.0.2|^9.0
- craftcms/cms: ^5.0
- endroid/qr-code: ^5.0
This package is auto-updated.
Last update: 2024-04-17 07:47:58 UTC
README
Generate a QR code
Requirements
This plugin requires Craft CMS 5.0 or later.
Installation
To install the plugin, follow these instructions.
- Open your terminal and go to your Craft project:
cd /path/to/project
- Then tell Composer to load the plugin:
composer require webdna/qrcode
- In the Control Panel, go to Settings → Plugins and click the “Install” button for QRCode.
QRCode Overview
This allows the generation of a QRCode via a fieldtype, variable or twig filter.
QRCode Options
All instances of QRCode accept the following parameters:
- Data: the data for the code.
- Size: the size in pixels (default: 300)
Using QRCode
Fieldtype: In the fieldtype settings, you can use twig to dynamically get properties of the element that it is set on. eg on a user element:
{"name":"{{ user.fullName }}"}
Twig variables:
{{ craft.qrcode.generate(1234567890) }}
{{ craft.qrcode.generate({"name":"John Smith"}, 100) }}
Twig Filters:
{{ 1234567890|qrcode }}
{{ {"name":"John Smith"}|qrcode(100) }}
Brought to you by webdna