【问题标题】:Cakephp upgrade php version showing errorCakephp升级php版本显示错误
【发布时间】:2015-12-12 10:59:27
【问题描述】:

我刚刚将服务器升级到 PHP 5.4,在加载项目时出现此错误,在旧版本中运行良好

Declaration of JsHelper::link() should be compatible with AppHelper::link($title, $url = NULL, $options = Array, $confirmMessage = false) [CORE\Cake\View\Helper\JsHelper.php, line 434]

我在窗口中使用 xampp

请告诉我如何解决它

【问题讨论】:

  • 你使用的是什么版本的 CakePHP?
  • 我在我的旧项目中使用 cakephp 2.0

标签: php cakephp xampp


【解决方案1】:

阅读错误信息

JsHelper::link() 的声明应该兼容 AppHelper::link($title, $url = NULL, $options = Array, $confirmMessage = false) [CORE\Cake\View\Helper\JsHelper.php , 第 434 行]

那就看the method signature for that method in the core

// JsHelper
link($title, $url = null, $options = array())

然后查看警告中的方法签名:

//AppHelper
link($title, $url = NULL, $options = Array, $confirmMessage = false)

然后再次阅读警告,它说它们不匹配。

解决方案

将应用程序中的一个类 AppHelper 更改为具有相同的方法签名:

//AppHelper
link($title, $url = NULL, $options = Array)

并相应地调整它包含的任何逻辑。

【讨论】:

  • 感谢亲爱的朋友,我找到了相同的解决方案,但感谢您的指导
猜你喜欢
  • 2022-01-24
  • 2015-07-28
  • 2018-03-10
  • 1970-01-01
  • 1970-01-01
  • 2018-01-03
  • 2020-01-03
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多