Welcome Guest, Not a member yet? Register   Sign In
autoloading dbforge
#1

[eluser]jordantkj[/eluser]
Hi,
I want to autoload the 'dbforge' class, so I don't need to worry about calling it specifically, like 'form' or 'database'. I tried to add it in the autoload.php file using 'dbforge', but its not working. The documentation doesn't mention autoloading this class, just how to load it from a file. Anyone know how to autoload this class?

Thanks,
-Tyler
#2

[eluser]CroNiX[/eluser]
Looking in the Loader class at the dbforge() method, it doesn't look natively possible because it isn't a single file.

You can add it by extending the Loader class with MY_Loader and in the _ci_autoloader() method have it check if "dbforge" is one of the libraries being autoloaded (like they check for database, which is another special case) and load it. However, dbforge() requires the database and database driver to be loaded first.




Theme © iAndrew 2016 - Forum software by © MyBB