Controller Class Reference

Inheritance diagram for Controller:
Collaboration diagram for Controller:

List of all members.


Public Member Functions

 Controller ()
 Constructor.
 _ci_initialize ()
 Initialize.
 _ci_scaffolding ()
 Run Scaffolding.

Public Attributes

 $_ci_scaffolding = FALSE
 $_ci_scaff_table = FALSE

Detailed Description

Definition at line 30 of file Controller.php.


Member Function Documentation

Controller::_ci_initialize (  ) 

Initialize.

Assigns all the bases classes loaded by the front controller to variables in this class. Also calls the autoload routine.

private

Returns:
void

Definition at line 58 of file Controller.php.

References $class, CI_Loader::_ci_autoloader(), and load_class().

Referenced by Controller().

00059         {
00060                 // Assign all the class objects that were instantiated by the
00061                 // front controller to local class variables so that CI can be
00062                 // run as one big super object.
00063                 $classes = array(
00064                                                         'config'        => 'Config',
00065                                                         'input'         => 'Input',
00066                                                         'benchmark'     => 'Benchmark',
00067                                                         'uri'           => 'URI',
00068                                                         'output'        => 'Output',
00069                                                         'lang'          => 'Language',
00070                                                         'router'        => 'Router'
00071                                                         );
00072                 
00073                 foreach ($classes as $var => $class)
00074                 {
00075                         $this->$var =& load_class($class);
00076                 }
00077 
00078                 // In PHP 5 the Loader class is run as a discreet
00079                 // class.  In PHP 4 it extends the Controller
00080                 if (floor(phpversion()) >= 5)
00081                 {
00082                         $this->load =& load_class('Loader');
00083                         $this->load->_ci_autoloader();
00084                 }
00085                 else
00086                 {
00087                         $this->_ci_autoloader();
00088                         
00089                         // sync up the objects since PHP4 was working from a copy
00090                         foreach (array_keys(get_object_vars($this)) as $attribute)
00091                         {
00092                                 if (is_object($this->$attribute))
00093                                 {
00094                                         $this->load->$attribute =& $this->$attribute;
00095                                 }
00096                         }
00097                 }
00098         }

Here is the call graph for this function:

Here is the caller graph for this function:

Controller::_ci_scaffolding (  ) 

Run Scaffolding.

private

Returns:
void

Definition at line 108 of file Controller.php.

References $method, and show_404().

00109         {
00110                 if ($this->_ci_scaffolding === FALSE OR $this->_ci_scaff_table === FALSE)
00111                 {
00112                         show_404('Scaffolding unavailable');
00113                 }
00114                 
00115                 $method = ( ! in_array($this->uri->segment(3), array('add', 'insert', 'edit', 'update', 'view', 'delete', 'do_delete'), TRUE)) ? 'view' : $this->uri->segment(3);
00116                 
00117                 require_once(BASEPATH.'scaffolding/Scaffolding'.EXT);
00118                 $scaff = new Scaffolding($this->_ci_scaff_table);
00119                 $scaff->$method();
00120         }

Here is the call graph for this function:

Controller::Controller (  ) 

Constructor.

Calls the initialize() function

Definition at line 40 of file Controller.php.

References _ci_initialize(), CI_Base::CI_Base(), and log_message().

Referenced by Welcome::Welcome().

00041         {       
00042                 parent::CI_Base();
00043                 $this->_ci_initialize();
00044                 log_message('debug', "Controller Class Initialized");
00045         }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Controller::$_ci_scaff_table = FALSE

Definition at line 33 of file Controller.php.

Controller::$_ci_scaffolding = FALSE

Definition at line 32 of file Controller.php.


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