CodeIgniter Forums
How do I pass a reference of the controller to a hook? - 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: How do I pass a reference of the controller to a hook? (/showthread.php?tid=23830)



How do I pass a reference of the controller to a hook? - El Forum - 10-22-2009

[eluser]natanv[/eluser]
Hi,

I would like to write a hook that automatically modifies/adds a few controller object properties on the "post_controller_constructor" or "controller_constructor" event but I'm not sure how I would pass a reference to the controller from the application/config/hooks.php page. Any help would be appreciated!

Thanks,
Natan