CodeIgniter Forums
Hooks and XHR - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Hooks and XHR (/showthread.php?tid=46795)



Hooks and XHR - El Forum - 11-15-2011

[eluser]dionysus[/eluser]
I'm trying to create an Audit library that will log users' activities to a db.

I've created the lib (moar like copy/pasted/modified Profiler.php) and am hooking into it. I hoped that post_controller or post_system would allow the library to run on calls to a controller. It appears, though, that the hook only activates on a full page load. e.g. when I log into the site, that Audit is logged to the db. However, using XHR to call a controller does not trigger the hook.

Is there a way to make this work?