Class CI_Router - echiong/testRepo GitHub Wiki

##Class CI_Router

Router Class

Parses URIs and determines routing

Package: [[CodeIgniter<a href="Package CodeIgniter.Libraries.md">Libraries]]
Category: Libraries
Author: ExpressionEngine Dev Team
Link: http://codeigniter.com/user_guide/general/routing.html
Located at system/core/Router.php

##Methods summary


public __construct ( )

Constructor

Runs the route mapping function.


public _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.


public _set_default_controller ( )

Set the default controller


public _set_request ( array $segments = array() )

Set the Route

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

Parameters

$segments array


public array _validate_request ( array $segments )

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

Parameters

$segments array

Returns array


public _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.


public set_class ( string $class )

Set the class name

Parameters

$class string


public string fetch_class ( )

Fetch the current class

Returns string


public set_method ( string $method )

Set the method name

Parameters

$method string


public string fetch_method ( )

Fetch the current method

Returns string


public set_directory ( string $dir )

Set the directory name

Parameters

$dir string


public string fetch_directory ( )

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

Returns string


public null _set_overrides ( array $routing )

Set the controller overrides

Parameters

$routing array

Returns null

<table class="summary" id="properties">
<caption>Properties summary</caption>
<tr data-order="config" id="$config">
	<td class="attributes"><code>
		public  
		object
	</code></td>

	<td class="name">

$config

#
		<div class="description detailed">

Config class

		</div>
	</div></td>
</tr>
<tr data-order="routes" id="$routes">
	<td class="attributes"><code>
		public  
		array
	</code></td>

	<td class="name">

$routes

array()
#
		<div class="description detailed">

List of routes

		</div>
	</div></td>
</tr>
<tr data-order="error_routes" id="$error_routes">
	<td class="attributes"><code>
		public  
		array
	</code></td>

	<td class="name">

$error_routes

array()
#
		<div class="description detailed">

List of error routes

		</div>
	</div></td>
</tr>
<tr data-order="class" id="$class">
	<td class="attributes"><code>
		public  
		string
	</code></td>

	<td class="name">

$class

''
#
		<div class="description detailed">

Current class name

		</div>
	</div></td>
</tr>
<tr data-order="method" id="$method">
	<td class="attributes"><code>
		public  
		string
	</code></td>

	<td class="name">

$method

'index'
#
		<div class="description detailed">

Current method name

		</div>
	</div></td>
</tr>
<tr data-order="directory" id="$directory">
	<td class="attributes"><code>
		public  
		string
	</code></td>

	<td class="name">

$directory

''
#
		<div class="description detailed">

Sub-directory that contains the requested controller class

		</div>
	</div></td>
</tr>
<tr data-order="default_controller" id="$default_controller">
	<td class="attributes"><code>
		public  
		string
	</code></td>

	<td class="name">

$default_controller

#
		<div class="description detailed">

Default controller (and method if specific)

		</div>
	</div></td>
</tr>
</table>
⚠️ **GitHub.com Fallback** ⚠️