Codeigniter share data from pre controller hook |
I want to do the similar job in controllers constructors. So I don't want to repeat it in each controller. Instead, I want to write it once in hook.
It works fine in post_controller_constructor hook with ci super object. But cannot access it in the controller's constructor (Only functions of a controller). pre_controller doesn't work. Because we don't access to ci super object at all. Any idea?
If you want to reuse Controller code in multiple Controllers, then create a MY_Controller in ./application/core
|
Welcome Guest, Not a member yet? Register Sign In |