Welcome Guest, Not a member yet? Register   Sign In
query in config files
#1

Hello,

I want get query items from database in config. I use Codeigniter HMVC but I can't use get_instance() in config.
How I can query in config files?
Reply
#2

It's usually best not to put any more code than is strictly necessary in a config file. Further, if get_instance() isn't available, you're dealing with a config file that is loaded relatively early in the application's life-cycle (for example, config.php or routes.php), so you have to assume that a lot of CI's functionality won't be available.

What are you trying to do? In most cases there are other options, especially with HMVC.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB