https://github.com/webdna/craft-qrcode
https://github.com/webdna/craft-qrcode
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/webdna/craft-qrcode
- Owner: webdna
- License: mit
- Created: 2019-02-04T11:42:10.000Z (over 7 years ago)
- Default Branch: craft5
- Last Pushed: 2024-04-17T07:47:55.000Z (about 2 years ago)
- Last Synced: 2025-06-06T09:15:37.028Z (about 1 year ago)
- Language: PHP
- Size: 71.3 KB
- Stars: 4
- Watchers: 1
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# QRCode plugin for Craft CMS 5.x
Generate a QR code
## Requirements
This plugin requires Craft CMS 5.0 or later.
## Installation
To install the plugin, follow these instructions.
1. Open your terminal and go to your Craft project:
```
cd /path/to/project
```
2. Then tell Composer to load the plugin:
```
composer require webdna/qrcode
```
3. 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:
1. **Data**: the data for the code.
2. **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](https://webdna.co.uk)