PHP code example of lizhaomiusi / yii2-qrcode-helper

1. Go to this page and download the library: Download lizhaomiusi/yii2-qrcode-helper 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/ */

    

lizhaomiusi / yii2-qrcode-helper example snippets


use dosamigos\qrcode\formats\MailTo;
use dosamigos\qrcode\QrCode;

\\ ...

public function actionQrcode() {
    $mailTo = new MailTo(['email' => '[email protected]']);
    return QrCode::png($mailTo->getText());
    // you could also use the following
    // return return QrCode::png($mailTo);
}

html
<img src="<?= Url::to(['route/qrcode'])