简体   繁体   English

Cakephp升级php版本显示错误

[英]Cakephp upgrade php version showing error

I've just upgraded my servers to PHP 5.4 and got this error when loading a project, which is working fine in old version我刚刚将我的服务器升级到 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]

i am using xampp in window我在窗口中使用 xampp

please tell me how can i solve it请告诉我我该如何解决

Read the error message阅读错误信息

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] JsHelper::link() 的声明应该与 AppHelper::link($title, $url = NULL, $options = Array, $confirmMessage = false) [CORE\\Cake\\View\\Helper\\JsHelper.php, line 434 兼容]

Then look at the method signature for that method in the core :然后查看核心中该方法的方法签名

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

Then look at the method signature in the warning:然后查看警告中的方法签名:

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

Then read the warning again, it's saying they don't match.然后再次阅读警告,说它们不匹配。

Solution解决方案

Change the AppHelper, a class in your application, to have the same method signature:将 AppHelper(应用程序中的一个类)更改为具有相同的方法签名:

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

And adjust any logic it contains accordingly.并相应地调整它包含的任何逻辑。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM