-
Notifications
You must be signed in to change notification settings - Fork 0
CI_Router
Router Class
Parses URIs and determines routing
- Class name: CI_Router
- Namespace:
public object $config
CI_Config class object
- Visibility: public
public array $routes = array()
List of routes
- Visibility: public
public string $class = ''
Current class name
- Visibility: public
public string $method = 'index'
Current method name
- Visibility: public
public string $directory
Sub-directory that contains the requested controller class
- Visibility: public
public string $default_controller
Default controller (and method if specific)
- Visibility: public
public boolean $translate_uri_dashes = FALSE
Translate URI dashes
Determines whether dashes in controller & method segments should be automatically replaced by underscores.
- Visibility: public
public boolean $enable_query_strings = FALSE
Enable query strings flag
Determines whether to use GET parameters or segment URIs
- Visibility: public
void CI_Router::__construct($routing)
Class constructor
Runs the route mapping function.
- Visibility: public
- $routing mixed
void CI_Router::_set_routing()
Set route mapping
Determines what should be served based on the URI request, as well as any "routes" that have been set in the routing config file.
- Visibility: protected
void CI_Router::_set_request(array $segments)
Set request route
Takes an array of URI segments as input and sets the class/method to be called.
- Visibility: protected
- $segments array - <p>URI segments</p>
void CI_Router::_set_default_controller()
Set default controller
- Visibility: protected
mixed CI_Router::_validate_request(array $segments)
Validate request
Attempts validate the URI request and determine the controller path.
- Visibility: protected
- $segments array - <p>URI segments</p>
void CI_Router::_parse_routes()
Parse Routes
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.
- Visibility: protected
void CI_Router::set_class(string $class)
Set class name
- Visibility: public
- $class string - <p>Class name</p>
string CI_Router::fetch_class()
Fetch the current class
- Visibility: public
void CI_Router::set_method(string $method)
Set method name
- Visibility: public
- $method string - <p>Method name</p>
string CI_Router::fetch_method()
Fetch the current method
- Visibility: public
void CI_Router::set_directory(string $dir, boolean $append)
Set directory name
- Visibility: public
- $dir string - <p>Directory name</p>
- $append boolean - <p>Whether we're appending rather than setting the full value</p>
string CI_Router::fetch_directory()
Fetch directory
Feches the sub-directory (if any) that contains the requested controller class.
- Visibility: public