37 lines
1014 B
PHP
Executable File
37 lines
1014 B
PHP
Executable File
<?php
|
|
|
|
namespace Home\Controller;
|
|
|
|
/**
|
|
* 二维码生成控制层
|
|
* @author Devil
|
|
* @blog http://gong.gg/
|
|
* @version 0.0.1
|
|
* @datetime 2016-12-01T21:51:08+0800
|
|
*/
|
|
class QrCodeController extends CommonController
|
|
{
|
|
/**
|
|
* [__construct 构造方法]
|
|
*/
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
}
|
|
|
|
/**
|
|
* [Index 首页方法]
|
|
*/
|
|
public function Index()
|
|
{
|
|
require_once APP_PATH.'Library'.DS.'Qrcode'.DS.'phpqrcode.php';
|
|
|
|
$level = isset($_REQUEST['level']) && in_array($_REQUEST['level'], array('L','M','Q','H')) ? $_REQUEST['level'] : 'L';
|
|
$point_size = isset($_REQUEST['size']) ? min(max(intval($_REQUEST['size']), 1), 10) : 6;
|
|
$mr = isset($_REQUEST['mr']) ? intval($_REQUEST['mr']) : 1;
|
|
$content = isset($_REQUEST['content']) ? urldecode(trim($_REQUEST['content'])) : __MY_URL__;
|
|
//print_r($content);die;
|
|
\QRcode::png($content, false, $level, $point_size, $mr);
|
|
}
|
|
}
|
|
?>
|