gpt4 book ai didi

php - 紧凑型(): undefined variable in zendframework

转载 作者:行者123 更新时间:2023-12-05 04:02:38 29 4
gpt4 key购买 nike

我在我的本地主机上使用 composer 安装了 zend 框架。我使用 xampp 的内置 php 服务器来部署我的 zendframework 应用程序。安装后有错误日志“compact(): Undefined variable: extras in C:\Users\oyela\Documents\zend\path\to\install\vendor\zendframework\zend-view\src\Helper\HeadLink.php在第 404 行”

我尝试在 HeadLink.php 文件中使用不同的命名空间:

$attributes = compact('rel', 'type', 'href', 'media', 'conditionalStylesheet', 'extras');

我希望显示 zend 索引页面,但它与此错误日志一起显示。

最佳答案

在 PHP 7.3 下,我们看到记录了以下内容:PHP 注意:compact(): Undefined variable: extras in src\Helper\HeadLink.php on line 413

快速修复将第 408-413 行替换为:

$attributes = compact('rel', 'type', 'href', 'media', 'conditionalStylesheet');

if ($args && is_array($args[0])) {
$attributes['extras'] = array_shift($args);
}

您可以在 PHP 7.3 issue with compact() in HeadLink.php #172

关于php - 紧凑型(): undefined variable in zendframework,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54298826/

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