Public Member Functions | |
CI_Loader () | |
library ($library= '', $params=NULL, $object_name=NULL) | |
model ($model, $name= '', $db_conn=FALSE) | |
database ($params= '', $return=FALSE, $active_record=FALSE) | |
dbutil () | |
dbforge () | |
view ($view, $vars=array(), $return=FALSE) | |
file ($path, $return=FALSE) | |
vars ($vars=array(), $val= '') | |
helper ($helpers=array()) | |
helpers ($helpers=array()) | |
plugin ($plugins=array()) | |
plugins ($plugins=array()) | |
language ($file=array(), $lang= '') | |
scaffold_language ($file= '', $lang= '', $return=FALSE) | |
config ($file= '', $use_sections=FALSE, $fail_gracefully=FALSE) | |
scaffolding ($table= '') | |
_ci_load ($_ci_data) | |
_ci_load_class ($class, $params=NULL, $object_name=NULL) | |
_ci_init_class ($class, $prefix= '', $config=FALSE, $object_name=NULL) | |
_ci_autoloader () | |
_ci_assign_to_models () | |
_ci_object_to_array ($object) | |
_ci_is_instance () | |
Public Attributes | |
$_ci_ob_level | |
$_ci_view_path = '' | |
$_ci_is_php5 = FALSE | |
$_ci_is_instance = FALSE | |
$_ci_cached_vars = array() | |
$_ci_classes = array() | |
$_ci_loaded_files = array() | |
$_ci_models = array() | |
$_ci_helpers = array() | |
$_ci_plugins = array() | |
$_ci_varmap = array('unit_test' => 'unit', 'user_agent' => 'agent') |
CI_Loader::_ci_assign_to_models | ( | ) |
Assign to Models
Makes sure that anything loaded by the loader class (libraries, plugins, etc.) will be available to models, if any exist.
private
object |
CI_Loader::_ci_autoloader | ( | ) |
Autoloader
The config/autoload.php file contains an array that permits sub-systems, libraries, plugins, and helpers to be loaded automatically.
private
array |
CI_Loader::_ci_init_class | ( | $ | class, | |
$ | prefix = '' , |
|||
$ | config = FALSE , |
|||
$ | object_name = NULL | |||
) |
Instantiates a class
private
string | ||
string | ||
string | an optional object name |
CI_Loader::_ci_is_instance | ( | ) |
Determines whether we should use the CI instance or $this
private
CI_Loader::_ci_load | ( | $ | _ci_data | ) |
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
private
array |
CI_Loader::_ci_load_class | ( | $ | class, | |
$ | params = NULL , |
|||
$ | object_name = NULL | |||
) |
Load class
This function loads the requested class.
private
string | the item that is being loaded | |
mixed | any additional parameters | |
string | an optional object name |
CI_Loader::_ci_object_to_array | ( | $ | object | ) |
Object to Array
Takes an object as input and converts the class variables to array key/vals
private
object |
CI_Loader::CI_Loader | ( | ) |
Constructor
Sets the path to the view files and gets the initial output buffering level
public
CI_Loader::config | ( | $ | file = '' , |
|
$ | use_sections = FALSE , |
|||
$ | fail_gracefully = FALSE | |||
) |
Loads a config file
public
string |
CI_Loader::database | ( | $ | params = '' , |
|
$ | return = FALSE , |
|||
$ | active_record = FALSE | |||
) |
Database Loader
public
string | the DB credentials | |
bool | whether to return the DB object | |
bool | whether to enable active record (this allows us to override the config setting) |
CI_Loader::dbforge | ( | ) |
Load the Database Forge Class
public
CI_Loader::dbutil | ( | ) |
Load the Utilities Class
public
CI_Loader::file | ( | $ | path, | |
$ | return = FALSE | |||
) |
Load File
This is a generic file loader
public
string | ||
bool |
CI_Loader::helper | ( | $ | helpers = array() |
) |
Load Helper
This function loads the specified helper file.
public
mixed |
CI_Loader::helpers | ( | $ | helpers = array() |
) |
Load Helpers
This is simply an alias to the above function in case the user has written the plural form of this function.
public
array |
CI_Loader::language | ( | $ | file = array() , |
|
$ | lang = '' | |||
) |
Loads a language file
public
array | ||
string |
CI_Loader::library | ( | $ | library = '' , |
|
$ | params = NULL , |
|||
$ | object_name = NULL | |||
) |
Class Loader
This function lets users load and instantiate classes. It is designed to be called from a user's app controllers.
public
string | the name of the class | |
mixed | the optional parameters | |
string | an optional object name |
CI_Loader::model | ( | $ | model, | |
$ | name = '' , |
|||
$ | db_conn = FALSE | |||
) |
Model Loader
This function lets users load and instantiate models.
public
string | the name of the class | |
string | name for the model | |
bool | database connection |
CI_Loader::plugin | ( | $ | plugins = array() |
) |
Load Plugin
This function loads the specified plugin.
public
array |
CI_Loader::plugins | ( | $ | plugins = array() |
) |
Load Plugins
This is simply an alias to the above function in case the user has written the plural form of this function.
public
array |
CI_Loader::scaffold_language | ( | $ | file = '' , |
|
$ | lang = '' , |
|||
$ | return = FALSE | |||
) |
Loads language files for scaffolding
public
string |
CI_Loader::scaffolding | ( | $ | table = '' |
) |
Scaffolding Loader
This initializing function works a bit different than the others. It doesn't load the class. Instead, it simply sets a flag indicating that scaffolding is allowed to be used. The actual scaffolding function below is called by the front controller based on whether the second segment of the URL matches the "secret" scaffolding word stored in the application/config/routes.php
public
string |
CI_Loader::vars | ( | $ | vars = array() , |
|
$ | val = '' | |||
) |
Set Variables
Once variables are set they become available within the controller class and its "view" files.
public
array |
CI_Loader::view | ( | $ | view, | |
$ | vars = array() , |
|||
$ | return = FALSE | |||
) |
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.
public
string | ||
array | ||
bool |
CI_Loader::$_ci_cached_vars = array() |
CI_Loader::$_ci_classes = array() |
CI_Loader::$_ci_helpers = array() |
CI_Loader::$_ci_is_instance = FALSE |
CI_Loader::$_ci_is_php5 = FALSE |
CI_Loader::$_ci_loaded_files = array() |
CI_Loader::$_ci_models = array() |
CI_Loader::$_ci_ob_level |
CI_Loader::$_ci_plugins = array() |
CI_Loader::$_ci_varmap = array('unit_test' => 'unit', 'user_agent' => 'agent') |
CI_Loader::$_ci_view_path = '' |