Cakephp 3 x call action A in Controller A in action B in Controller B

How can I do this?

  1. For example: action(function) deleteUser in UsersController and want to call deleteUser in (function) checkqualifiedUser in CompetitionController,
  2. how can we use $this->Users->save($user) in CompetitionController or othercontrollers?

Thanks,

  1. Move that logic to model, load model into Controller A trigger it when needed, load model into Controller B trigger it when needed.

  2. In controller $this->loadModel('ModelName');

I suggest you to read book, as you are asking questions that are already answered there.

1 Like

Thanks, the online cook book I read ,but maybe I new to this. Will read again