CI_Loader Class Reference

Inherited by CI_Base.

List of all members.

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')


Member Function Documentation

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

Parameters:
object 
Returns:
array

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

Parameters:
array 
Returns:
void

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

Instantiates a class

private

Parameters:
string 
string 
string an optional object name
Returns:
null

CI_Loader::_ci_is_instance (  ) 

Determines whether we should use the CI instance or $this

private

Returns:
bool

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

Parameters:
array 
Returns:
void

CI_Loader::_ci_load_class ( class,
params = NULL,
object_name = NULL 
)

Load class

This function loads the requested class.

private

Parameters:
string the item that is being loaded
mixed any additional parameters
string an optional object name
Returns:
void

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

Parameters:
object 
Returns:
array

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

Parameters:
string 
Returns:
void

CI_Loader::database ( params = '',
return = FALSE,
active_record = FALSE 
)

Database Loader

public

Parameters:
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)
Returns:
object

CI_Loader::dbforge (  ) 

Load the Database Forge Class

public

Returns:
string

CI_Loader::dbutil (  ) 

Load the Utilities Class

public

Returns:
string

CI_Loader::file ( path,
return = FALSE 
)

Load File

This is a generic file loader

public

Parameters:
string 
bool 
Returns:
string

CI_Loader::helper ( helpers = array()  ) 

Load Helper

This function loads the specified helper file.

public

Parameters:
mixed 
Returns:
void

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

Parameters:
array 
Returns:
void

CI_Loader::language ( file = array(),
lang = '' 
)

Loads a language file

public

Parameters:
array 
string 
Returns:
void

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

Parameters:
string the name of the class
mixed the optional parameters
string an optional object name
Returns:
void

CI_Loader::model ( model,
name = '',
db_conn = FALSE 
)

Model Loader

This function lets users load and instantiate models.

public

Parameters:
string the name of the class
string name for the model
bool database connection
Returns:
void

CI_Loader::plugin ( plugins = array()  ) 

Load Plugin

This function loads the specified plugin.

public

Parameters:
array 
Returns:
void

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

Parameters:
array 
Returns:
void

CI_Loader::scaffold_language ( file = '',
lang = '',
return = FALSE 
)

Loads language files for scaffolding

public

Parameters:
string 
Returns:
arra

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

Parameters:
string 
Returns:
void

CI_Loader::vars ( vars = array(),
val = '' 
)

Set Variables

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

public

Parameters:
array 
Returns:
void

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

Parameters:
string 
array 
bool 
Returns:
void


Member Data Documentation

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 = ''


The documentation for this class was generated from the following file:

Generated on Sun Nov 16 16:09:16 2008 for CodeIgniter by  doxygen 1.5.7.1