Properties

$_ci_ob_level

$_ci_ob_level : integer

Nesting level of the output buffering mechanism

Type

integer

$_ci_view_paths

$_ci_view_paths : array

List of paths to load views from

Type

array

$_ci_library_paths

$_ci_library_paths : array

List of paths to load libraries from

Type

array

$_ci_model_paths

$_ci_model_paths : array

List of paths to load models from

Type

array

$_ci_helper_paths

$_ci_helper_paths : array

List of paths to load helpers from

Type

array

$_base_classes

$_base_classes : array

List of loaded base classes Set by the controller class

Type

array

$_ci_cached_vars

$_ci_cached_vars : array

List of cached variables

Type

array

$_ci_classes

$_ci_classes : array

List of loaded classes

Type

array

$_ci_loaded_files

$_ci_loaded_files : array

List of loaded files

Type

array

$_ci_models

$_ci_models : array

List of loaded models

Type

array

$_ci_helpers

$_ci_helpers : array

List of loaded helpers

Type

array

$_ci_varmap

$_ci_varmap : array

List of class name mappings

Type

array

Methods

__construct()

__construct() 

Constructor

Sets the path to the view files and gets the initial output buffering level

initialize()

initialize() : object

Initialize the Loader

This method is called once in CI_Controller.

Returns

object

is_loaded()

is_loaded(  $class) : mixed

Is Loaded

A utility function to test if a class is in the self::$_ci_classes array. This function returns the object name if the class tested for is loaded, and returns FALSE if it isn't.

It is mainly used in the form_helper -> _get_validation_object()

Parameters

$class

Returns

mixed —

class object name on the CI SuperObject or FALSE

library()

library(  $library = '',   $params = NULL,   $object_name = NULL) : void

Class Loader

This function lets users load and instantiate classes. It is designed to be called from a user's app controllers.

Parameters

$library
$params
$object_name

model()

model(  $model,   $name = '',   $db_conn = FALSE) : void

Model Loader

This function lets users load and instantiate models.

Parameters

$model
$name
$db_conn

database()

database(  $params = '',   $return = FALSE,   $active_record = NULL) : object

Database Loader

Parameters

$params
$return
$active_record

Returns

object

dbutil()

dbutil() : string

Load the Utilities Class

Returns

string

dbforge()

dbforge() : string

Load the Database Forge Class

Returns

string

view()

view(  $view,   $vars = array(),   $return = FALSE) : void

Load View

This function is used to load a "view" file. It has three parameters:

  1. The name of the "view" file to be included.
  2. An associative array of data to be extracted for use in the view.
  3. TRUE/FALSE - whether to return the data or load it. In some cases it's advantageous to be able to return data so that a developer can process it in some way.

Parameters

$view
$vars
$return

file()

file(  $path,   $return = FALSE) : string

Load File

This is a generic file loader

Parameters

$path
$return

Returns

string

vars()

vars(  $vars = array(),   $val = '') : void

Set Variables

Once variables are set they become available within the controller class and its "view" files.

Parameters

$vars
$val

get_var()

get_var(  $key) : void

Get Variable

Check if a variable is set and retrieve it.

Parameters

$key

helper()

helper(  $helpers = array()) : void

Load Helper

This function loads the specified helper file.

Parameters

$helpers

helpers()

helpers(  $helpers = array()) : void

Load Helpers

This is simply an alias to the above function in case the user has written the plural form of this function.

Parameters

$helpers

language()

language(  $file = array(),   $lang = '') : void

Loads a language file

Parameters

$file
$lang

config()

config(  $file = '',   $use_sections = FALSE,   $fail_gracefully = FALSE) : void

Loads a config file

Parameters

$file
$use_sections
$fail_gracefully

driver()

driver(  $library = '',   $params = NULL,   $object_name = NULL) : void

Driver

Loads a driver library

Parameters

$library
$params
$object_name

add_package_path()

add_package_path(  $path,   $view_cascade = TRUE) : void

Add Package Path

Prepends a parent path to the library, model, helper, and config path arrays

Parameters

$path
$view_cascade

get_package_paths()

get_package_paths(  $include_base = FALSE) : void

Get Package Paths

Return a list of all package paths, by default it will ignore BASEPATH.

Parameters

$include_base

remove_package_path()

remove_package_path(  $path = '',   $remove_config_path = TRUE) : \type

Remove Package Path

Remove a path from the library, model, and helper path arrays if it exists If no path is provided, the most recently added path is removed.

Parameters

$path
$remove_config_path

Returns

\type

_ci_load()

_ci_load(  $_ci_data) : void

Loader

This function is used to load views and files. Variables are prefixed with ci to avoid symbol collision with variables made available to view files

Parameters

$_ci_data

_ci_load_class()

_ci_load_class(  $class,   $params = NULL,   $object_name = NULL) : void

Load class

This function loads the requested class.

Parameters

$class
$params
$object_name

_ci_init_class()

_ci_init_class(  $class,   $prefix = '',   $config = FALSE,   $object_name = NULL) : null

Instantiates a class

Parameters

$class
$prefix
$config
$object_name

Returns

null

_ci_object_to_array()

_ci_object_to_array(  $object) : array

Object to Array

Takes an object as input and converts the class variables to array key/vals

Parameters

$object

Returns

array

_ci_get_component()

_ci_get_component(  $component) : boolean

Get a reference to a specific library or model

Parameters

$component

Returns

boolean

_ci_prep_filename()

_ci_prep_filename(  $filename,   $extension) : array

Prep filename

This function preps the name of various items to make loading them more reliable.

Parameters

$filename
$extension

Returns

array

_ci_autoloader()

_ci_autoloader() : void

Autoloader

The config/autoload.php file contains an array that permits sub-systems, libraries, and helpers to be loaded automatically.