CI_Loader::model()

model($model[, $name = ''[, $db_conn = FALSE]]) Parameters: $model (mixed) – Model name or an array containing multiple models $name (string) – Optional object name to assign the model to $db_conn (string) – Optional database configuration group to load Returns: CI_Loader instance (method chaining) Return type: CI_Loader $this->load->model('model_name'); If your model is located in a subdirectory, include the relative path from your models directory. For example, if you hav

CI_Loader::remove_package_path()

remove_package_path([$path = '']) Parameters: $path (string) – Path to remove Returns: CI_Loader instance (method chaining) Return type: CI_Loader When your controller is finished using resources from an application package, and particularly if you have other application packages you want to work with, you may wish to remove the package path so the Loader no longer looks in that directory for resources. To remove the last path added, simply call the method with no parameters. Or to

CI_Loader::helper()

helper($helpers) Parameters: $helpers (mixed) – Helper name as a string or an array containing multiple helpers Returns: CI_Loader instance (method chaining) Return type: CI_Loader This method loads helper files, where file_name is the name of the file, without the _helper.php extension.

CI_Loader::is_loaded()

is_loaded($class) Parameters: $class (string) – Class name Returns: Singleton property name if found, FALSE if not Return type: mixed Allows you to check if a class has already been loaded or not. Note The word “class” here refers to libraries and drivers. If the requested class has been loaded, the method returns its assigned name in the CI Super-object and FALSE if it’s not: $this->load->library('form_validation'); $this->load->is_loaded('Form_validation'); // r

CI_Loader::get_package_paths()

get_package_paths([$include_base = TRUE]) Parameters: $include_base (bool) – Whether to include BASEPATH Returns: An array of package paths Return type: array Returns all currently available package paths.

CI_Loader::language()

language($files[, $lang = '']) Parameters: $files (mixed) – Language file name or an array of multiple language files $lang (string) – Language name Returns: CI_Loader instance (method chaining) Return type: CI_Loader This method is an alias of the language loading method: $this->lang->load().

CI_Loader::get_var()

get_var($key) Parameters: $key (string) – Variable name key Returns: Value if key is found, NULL if not Return type: mixed This method checks the associative array of variables available to your views. This is useful if for any reason a var is set in a library or another controller method using $this->load->vars().

CI_Loader::get_vars()

get_vars() Returns: An array of all assigned view variables Return type: array This method retrieves all variables available to your views.

CI_Loader::dbforge()

dbforge([$db = NULL[, $return = FALSE]]) Parameters: $db (object) – Database object $return (bool) – Whether to return the Database Forge instance Returns: Loaded CI_DB_forge instance if $return is set to TRUE, otherwise CI_Loader instance (method chaining) Return type: mixed Loads the Database Forge class, please refer to that manual for more info.

CI_Loader::dbutil()

dbutil([$db = NULL[, $return = FALSE]]) Parameters: $db (object) – Database object $return (bool) – Whether to return the Database Utilities instance Returns: Loaded CI_DB_utility instance if $return is set to TRUE, otherwise CI_Loader instance (method chaining) Return type: mixed Loads the Database Utilities class, please refer to that manual for more info.