Hi,
I play around with the examples from the documentation.
But when i want to inject a service into the constructor of a controller
public function __construct(UserAvatarService $userAvatarService)
{
parent::__construct();
$this->userAvatarService = $userAvatarService;
}
i get following error:
The request object does not contain the required
authentication
attribute
When i put
$this->loadComponent(‘Authentication.Authentication’);
into the beforeFilter Section of the AppController, i get an error with too many redirects.
Has anyone a good solution to inject a service into an controller without these authentification issues?
Thanks
David