Welcome Guest, Not a member yet? Register   Sign In
pre_controller hook database access
#1

[eluser]Unknown[/eluser]
Hi all,

I've been trying to create a pre_controller hook that has database access. I am aware the db code is not loaded at that point so I have been trying to figure out if it can be loaded. More over I am wondering my original approach was correct. Originally, the pre_controller was a extension of the Controller class. This did work fine until I tried to get the actual app controller to access the database. Then it basically told me it was a undefined function. I have done several days of research, trail and error. I have learned much of codeignitor, but I still do not understand how or if it can be done. A possible solution would be a db layer thats not part of CI and that I can load on the fly. I would though like to basically have the pre_controller access the MySQL db via the CI active record stuff and have the main app controller still work. So how can I do this?




Theme © iAndrew 2016 - Forum software by © MyBB