CakePHP3 & CakePHP4: Get the Name of the Controller or Method

CakePHP3 & CakePHP4: Get the Name of the Controller or Method

CakePHP 3 or CakePHP 4:

debug($this->request->getParam('controller'));

 

CakePHP 3:
 

Get the method / action name:

debug($this->request->params['action']);

 

Get the controller:

debug($this->request->params['controller']);

Share this Post