Welcome Guest, Not a member yet? Register   Sign In
tracking user activity via user agent
#1

Hi,

I was thinking of creating a function where i able to record my user's user agent or referrer.

The idea is the moment a user entered the my website no matter from which url/controller. i want to record the user agent/referrer data.

However, is it the only way achieve this is i need to put the this->referrer helper to all my controller method?

Or is there any kind of ''global controller' where it will be applied to all instances?
best approach i think of right now is by using __construct() in all controller. but still, need to applied to all controller rather than 1 for all approach.
Reply
#2

Put it in a BaseController and extend it from your other ones, just like you are extending CI_Controller (if on CI3)
Reply
#3

(05-04-2020, 03:53 AM)jreklund Wrote: Put it in a BaseController and extend it from your other ones, just like you are extending CI_Controller (if on CI3)
yes.
base controller.
tyvm.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB