Use Ariel Ferrandini PHPQRCode library (https://github.com/aferrandini/PHPQRCode)
Add EdgarEzQRCodeBundle by running this command from the terminal at the root of your eZPlatform project:
composer require edgarez/qrcodebundle
To start using the bundle, register the bundle in your application's kernel class:
// ezpublish/EzPublishKernel.php
public function registerBundles()
{
$bundles = array(
// ...
new EdgarEz\QRCodeBundle\EdgarEzQRCodeBundle(),
// ...
);
}
Install assets for this new Bundle
php ezpublish/console assets:install
// Text to QRCodize
<img src="{{ asset(eez_qrcode('foo')) }}"" />
// Level of error correction (3 by default, should be at least 0, maximum 3)
<img src="{{ asset(eez_qrcode('foo', 3)) }}"" />
// Size of QRCode image
<img src="{{ asset(eez_qrcode('foo', 3, 4)) }}"" />
// Margin of QRCode image
<img src="{{ asset(eez_qrcode('foo', 3, 4, 5)) }}"" />