CodeIgniter Forums

Full Version: Dynamic autoload.php (how to get values from database?)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]koniciwa[/eluser]
Facing a situation now where I need to allow users to customize the loaded libraries from autoload. These values are stored in the database. The problem is that the database is only loaded after processing the autoload.php file and not before, leaving me with mysql_query() to do the task of retrieving from database. I'm just wondering if there's a better way to do this?

Thanks

El Forum

[eluser]Michael Wales[/eluser]
Just add your own library loading function to the Controller constructor that pulls the libraries you want to load from the database via Active Record (if that's the route you want to take - I assume so, since you don't want to use mysql_query()).

El Forum

[eluser]koniciwa[/eluser]
Thanks for pointing me in the right direction.
I've looked everywhere but the obvious Smile

The loader has been ported to a library which is called by a hook. Works great, though I've yet to find the right loading sequence.