gpt4 book ai didi

php - 更改模块名称

转载 作者:行者123 更新时间:2023-11-29 19:35:12 25 4
gpt4 key购买 nike

我正在定制一个开源 pheebooks。我想更改其中的模块名称。我确实成功更改了 phreebooks 和 phreedom 的模块名称,但是当我更改 phreedom 的名称时,我无法打印任何 pdf。我收到此错误

User: 1 Company: phree RUN-TIME WARNING: 'Creating default object from empty value' line 50 in file 

F:\wamp\www\phree\modules\report\pages\popup_gen\pre_process.php

第50行,代码是这样的

 if (isset($_GET['xfld'])) $report->xfilterlist[0]->fieldname = $_GET['xfld'];

有人可以告诉我我到底做错了什么吗?过去三天我一直在绑它。

已编辑

if (isset($_GET['xfld'])) {//检查额外的过滤器
if (!isset($_GET['xfld'])) $xfld = new stdClass();
回显“空白”;
if (isset($_GET['xfld'])) $report->xfilterlist[0]->fieldname = $_GET['xfld'];
if (isset($_GET['xcr'])) $report->xfilterlist[0]->default = $_GET['xcr'];
if (isset($_GET['xmin'])) $report->xfilterlist[0]->min_val = $_GET['xmin'];
if (isset($_GET['xmax'])) $report->xfilterlist[0]->max_val = $_GET['xmax'];
}

我确实喜欢这个它显示“BLANK”,但实际上 isset($_GET['xfld'] 是从 URL SET 的。

最佳答案

$_GET['xfld'] = $xfld;


$xfld = NULL;
$xfld->success = false; // Warning: Creating default object from empty value

如果 $xfld 已初始化为某个值但不是对象,PHP 将报告不同的错误消息:

$xfld = something;
$xfld->success = false; // Warning: Attempt to assign property of non-object

您应该检查该对象是否已经存在:

if (!isset($_GET['xfld'])) $xfld = new stdClass();

否则,此代码并不是“旧 PHP”隐式对象创建的等效替代。

关于php - 更改模块名称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41588558/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com