You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adam Patterson edited this page Dec 18, 2012
·
1 revision
What Are They?
Libraries in Dingo give your applications advanced functionality. An example would be database access.
How To Use A Library
Libraries can be loaded from controllers, views, helpers, or even other libraries. It only takes one line of code to load a library.
load::library('db');
The above code would load the Databasing library that is included with Dingo.
Auto Loading Libraries
If you are going to use a particular library a lot, then you should consider auto loading it by adding it to the autoload_libraries array in application/config/development/config.php. For example, you could auto load the Databasing library by editing config.php like so:
/* Auto Load Libraries */
config::set('autoload_libraries',array('db'));
It is also possible to load libraries on a controller-by-controller basis by adding the $autoload_libraries array to the controller class.
class main_controller
{
public $autoload_libraries = array('db');
// ...
}