Friday, March 18, 2022

[FIXED] Get current action in CakePHP 3

Issue

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?


Solution

$this->request->actionOR $this->request->params['action'] both works.



Answered By - Danilo Azevedo

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.