获取当前操作在CakePHP 2我能得到通过$this->action
当前动作,但在CakePHP中3.X我再也不能用这个,因为它返回以下错误:CakePHP中3
Error: actionHelper could not be found.
如何在CakePHP 3中获取当前操作?
获取当前操作在CakePHP 2我能得到通过$this->action
当前动作,但在CakePHP中3.X我再也不能用这个,因为它返回以下错误:CakePHP中3
Error: actionHelper could not be found.
如何在CakePHP 3中获取当前操作?
$this->request->action
或$this->request->params['action']
两者都有效。
是的,这将工作! – Chandresh 2015-02-09 06:25:08
它没有给出正确的操作名称,只有第二个URL参数。 – afilina 2015-11-20 13:19:49
谢谢...为我工作 – mostafaznv 2016-08-29 13:30:54
'$ this-> action'已经在2.x中被定义了! – mark 2015-02-08 21:48:51