Dan*_*edo 3 php controller cakephp cakephp-3.0
在CakePHP 2中我可以通过使用获取当前操作$this->action,但在CakePHP 3.x中我不能再使用它了,因为它返回以下错误:
$this->action
Error: actionHelper could not be found.
如何在CakePHP 3中获取当前操作?
Dan*_*edo 12
$this->request->action或$this->request->params['action']两者都有效.
$this->request->action
$this->request->params['action']
小智 5
从 CakePHP 3.6 开始使用非弃用 $this->request->getParam('action')
$this->request->getParam('action')
在 CakePHP 3.7 中使用:
$this->getRequest()->getParam('action')
归档时间:
10 年,9 月 前
查看次数:
8622 次
最近记录:
6 年,5 月 前