Reputation: 243
In CakePHP 2 I could get the current action by using $this->action
, but in CakePHP 3.x I can't use this anymore, as it returns the following error:
Error: actionHelper could not be found.
How do I get the current action in CakePHP 3?
Upvotes: 4
Views: 10423
Reputation: 76
Starting from CakePHP 3.6 use non-deprecated $this->request->getParam('action')
Upvotes: 5
Reputation: 243
$this->request->action
OR $this->request->params['action']
both works.
Upvotes: 13