My Project
 All Data Structures Namespaces Functions Variables
Public Member Functions | Data Fields
CI_Router Class Reference

Public Member Functions

 __construct ()
 
 _set_routing ()
 
 _set_default_controller ()
 
 _set_request ($segments=array())
 
 _validate_request ($segments)
 
 _parse_routes ()
 
 set_class ($class)
 
 fetch_class ()
 
 set_method ($method)
 
 fetch_method ()
 
 set_directory ($dir)
 
 fetch_directory ()
 
 _set_overrides ($routing)
 

Data Fields

 $config
 
 $routes = array()
 
 $error_routes = array()
 
 $class = ''
 
 $method = 'index'
 
 $directory = ''
 
 $default_controller
 

Constructor & Destructor Documentation

__construct ( )

Constructor

Runs the route mapping function.

Member Function Documentation

_parse_routes ( )

Parse Routes

This function matches any routes that may exist in the config/routes.php file against the URI to determine if the class/method need to be remapped.

private

Returns
void
_set_default_controller ( )

Set the default controller

private

Returns
void
_set_overrides (   $routing)

Set the controller overrides

public

Parameters
array
Returns
null
_set_request (   $segments = array())

Set the Route

This function takes an array of URI segments as input, and sets the current class/method

private

Parameters
array
bool
Returns
void
_set_routing ( )

Set the route mapping

This function determines what should be served based on the URI request, as well as any "routes" that have been set in the routing config file.

private

Returns
void
_validate_request (   $segments)

Validates the supplied segments. Attempts to determine the path to the controller.

private

Parameters
array
Returns
array
fetch_class ( )

Fetch the current class

public

Returns
string
fetch_directory ( )

Fetch the sub-directory (if any) that contains the requested controller class

public

Returns
string
fetch_method ( )

Fetch the current method

public

Returns
string
set_class (   $class)

Set the class name

public

Parameters
string
Returns
void
set_directory (   $dir)

Set the directory name

public

Parameters
string
Returns
void
set_method (   $method)

Set the method name

public

Parameters
string
Returns
void

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