cakephp3会话已弃用 [英] cakephp3 session deprecated
本文介绍了cakephp3会话已弃用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经将cakephp core的最新版本更新到我的项目中。
现在我收到此错误:
I have update into my project the last version of cakephp core. Now I get this error:
Deprecated (16384): SessionHelper has been deprecated. Use request->session() instead. [CORE/src/View/Helper/sessionHelper.php, line 39]
我认为的错误是在此行中:
The error I think is in this line:
if ($this->session->read('admin_logged_in')){
我应该用什么代替?
谢谢
推荐答案
if ($this->request->session->read('admin_logged_in')){
应该没事。
更新
根据@raph的评论,正确答案下方是
As per the comment of @raph below the correct answer is
$this->request->session()->read('admin_logged_in')
请注意会话后的()
这篇关于cakephp3会话已弃用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文