CI中使用phpqrcode问题

_于小鱼_ 2016-05-22 11:46:41
请问下 我使用phpqrcode 来生成二维码时, 直接在controllers目录的文件下 能正常生成, 但是调用模型在模型里调用QRcode::png()函数就生成不了, 什么原因呢?
...全文
503 15 打赏 收藏 转发到动态 举报
写回复
用AI写文章
15 条回复
切换为时间正序
请发表友善的回复…
发表回复
qq_15590279 2016-06-21
  • 打赏
  • 举报
回复
phpqrcode如何关闭常量,我需要批量生成二维码
_于小鱼_ 2016-05-22
  • 打赏
  • 举报
回复
我是直接写的 QRcode:png() 然后就输不出二维码
xuzuning 2016-05-22
  • 打赏
  • 举报
回复
你在模板中是怎么写的? QRcode::png() 得到的是图片数据流
_于小鱼_ 2016-05-22
  • 打赏
  • 举报
回复
这样生成的图片能有办法居中吗?
_于小鱼_ 2016-05-22
  • 打赏
  • 举报
回复
原来是文件编码的问题, 这都能看出 真是好厉害 非常感谢~!
xuzuning 2016-05-22
  • 打赏
  • 举报
回复

看到了吧?有BOM 头!
_于小鱼_ 2016-05-22
  • 打赏
  • 举报
回复
http://woo.ecweb.kaffalab.com/front_action/payment/test  你看下输出的就是这个 生成不了二维码
xuzuning 2016-05-22
  • 打赏
  • 举报
回复
Modules::load('ayment_gateway/payment_gateway)->test(); 输出的是什么?
_于小鱼_ 2016-05-22
  • 打赏
  • 举报
回复
调用是直接controllers 下的文件里调用的 调用函数   public function test(){ // QRcode::png("http://www.baidu.com"); // 这样可以直接输出 Modules::load('ayment_gateway/payment_gateway)->test(); // 调用后就不可以   }
xuzuning 2016-05-22
  • 打赏
  • 举报
回复
你自己都说了 直接在controllers目录的文件下 能正常生成, 但是调用模型在模型里调用QRcode::png()函数就生成不了 那你不给看是怎么调用的,怎么找问题? 难道你认为是 QRcode::png("http://www.baidu.com"); 本身错了?
_于小鱼_ 2016-05-22
  • 打赏
  • 举报
回复
对 测试用的 所以写的简单的  public function test(){ QRcode::png("http://www.baidu.com"); }
xuzuning 2016-05-22
  • 打赏
  • 举报
回复
就这一句???
_于小鱼_ 2016-05-22
  • 打赏
  • 举报
回复
QRcode::png("http://www.baidu.com");  就这样
xuzuning 2016-05-22
  • 打赏
  • 举报
回复
让你告诉我你是怎么写的,就那么难吗?
_于小鱼_ 2016-05-22
  • 打赏
  • 举报
回复
什么原因呢? 大神指教呀
/** * weapp.qrcode.js v1.0.0 (https://github.com/yingye/weapp-qrcode#readme) */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global.drawQrcode = factory()); }(this, (function () { 'use strict'; var hasOwn = Object.prototype.hasOwnProperty; var toStr = Object.prototype.toString; var defineProperty = Object.defineProperty; var gOPD = Object.getOwnPropertyDescriptor; var isArray = function isArray(arr) { if (typeof Array.isArray === 'function') { return Array.isArray(arr); } return toStr.call(arr) === '[object Array]'; }; var isPlainObject = function isPlainObject(obj) { if (!obj || toStr.call(obj) !== '[object Object]') { return false; } var hasOwnConstructor = hasOwn.call(obj, 'constructor'); var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf'); // Not own constructor property must be Object if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) { return false; } // Own properties are enumerated firstly, so to speed up, // if last one is own, then all properties are own. var key; for (key in obj) { /**/ } return typeof key === 'undefined' || hasOwn.call(obj, key); }; // If name is '__proto__', and Object.defineProperty is available, define __proto__ as an own property on target var setProperty = function setProperty(target, options) { if (defineProperty && options.name === '__proto__') { defineProperty(target, options.name, { enumerable: true, configurable: true, value: options.newValue, writable: true }); } else { target[options.name] = options.newValue; } }; // Return undefined instead of __proto__ if '__proto__' is not an own property var getProperty = function getProperty(obj, name) { if (name === '__proto__') { if (!hasOwn.call(obj, name)) { return void 0; } else if (gOPD) {

4,250

社区成员

发帖
与我相关
我的任务
社区描述
国内外优秀PHP框架讨论学习
社区管理员
  • Framework
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧