I've been struggle with this for hours. I would like to use helpers and the user_agent library on a model.
User_agent: every-time I'm trying to load the user agent library using the next code:
$agent = $this->request->getUserAgent();
I getting the next error:
Error Call to a member function getUserAgent() on null
- When trying to load helper and use it from model for example cookie helper:
helper(cookie);
I think it's loading the helper but when trying to use it I printing next error:
Error Call to a member function is_mobile() on null