Welcome Guest, Not a member yet? Register   Sign In
Extending controller with function
#1

[eluser]Hallas[/eluser]
Hello All !

Im a noob in codeigniter an started to work with it, everything seems to be ok till I had to implement function that will reside in almost all controllers and it has a task to log in mySQL some actions that user did.

So, my question is how can I include function that will do some logging action after model returns success, in almost every controller that I have ?


Kind Regards,
Robert
#2

[eluser]InsiteFX[/eluser]
Phil Sturgeon - CodeIgniter Base Classes: Keeping it DRY
#3

[eluser]Hallas[/eluser]
Thanx, Ill have a look @ link.

Till now I created loggEvent class in library with few static public functions and Ill test if this gonna cover my needs. It seems that it is working great when included in model.

I hope this aproach is ok, if someone has any other idea please tell me.

I need to log every loging attempt, creating new users, deleting etc....






Theme © iAndrew 2016 - Forum software by © MyBB