adminweb/qrcode-zf2-module

此包已被废弃,不再维护。未建议替代包。
关于此包最新版本(0.0.10)没有可用的许可信息。

使用谷歌API生成二维码的zend framework 2模块。

0.0.10 2013-12-02 19:40 UTC

This package is not auto-updated.

Last update: 2022-10-07 13:26:53 UTC


README

使用谷歌API生成二维码的zend framework 2模块。

更多内容请见 https://developers.google.com/chart/infographics/docs/qr_codes

使用方法

  1. 在 application.config.php 文件中

     return array(
           'modules' => array(
                ...,
                'QRCode',
                ....     
  2. 在控制器中

     $qr = $this->getServiceLocator()->get('QRCode');
         $qr->isHttps(); // or $qr->isHttp();
         $qr->setData('Lorem Ipsum');
         $qr->setDimensions(50, 50);
         return new ViewModel(array('img'=> $qr->getResult()));
  3. 在视图中

     <img src="<?php echo $this->img; ?>" />