Some times ago I wrote a component that I find very convenient to use instead of other kind of authorization tools. I have converted it to CakePHP 3 and it still suits perfectly to my needs, but now I need to call one of its functions from a helper, and I can't figure out how to do that. The component name is PermissionsComponent.
Here is a draft of my helper:
namespace App\View\Helper;
use Cake\View\Helper;
use App\Controllers\Component\PermissionsComponent;
class PermissionsHelper extends Helper {
function check($action, $redirect = false) {
// how can I call my component's action check($action, $redirect)?
}
}
How can I call that component's action from a helper?