installation via composer :
1. The following method is loaded via composer
PHP Composer.phar require "2amigos/yii2-qrcode-helper" "*"
or add
"2amigos/yii2-qrcode-helper": "*"
To the Composer.json file of the corresponding project
To install through an archive file:
Not accustomed to use composer users can click here to download the QR code extension .
Then unzip, change the file name to yii2-qrcode-helper into the vendor/2amigos/directory
Edit/vendor/yiisoft/extensions.php, add the following code to the array
' 2amigos/yii2-qrcode-helper ' = = Array ( ' name ' = ' 2amigos/yii2-qrcode-helper ', ' version ' = ' = ') 1.0.2.0 ', ' alias ' = = Array ( ' @dosamigos/qrcode ' = = $vendorDir. '/2amigos/yii2-qrcode-helper/src ', ),),
Usage
Add the code to your controller
Use Dosamigos\qrcode\qrcode; Introduce class \ \ ... public function Actionqrcode () { return QRCode::p ng (' http://www.yii-china.com '); Call the two-dimensional code generation method}public function Actiondemo () { return $this->render (' Index ');}
Add the following code to your page (Demo/index)
Access Demo This way, you can see a beautiful two-dimensional code