Methods

Fetch the controller prefix to be used, or set a default if not defined

_init() 

Add one or multiple routes

add(string $path, string | array | \Fuel\Core\Route $options, bool $prepend, bool $case_sensitive) 

Parameters

$path

string

$options

stringarray\Fuel\Core\Route

either the translation for $path, an array for verb routing or an instance of Route

$prepend

bool

whether to prepend the route(s) to the routes array

$case_sensitive

bool

whether to check case sensitive

Delete one or multiple routes

delete(string | array $path, bool $case_sensitive) 

Parameters

$path

stringarray

route path, or array of route paths

$case_sensitive

bool

whether to check case sensitive

Does reverse routing for a named route.

get(string $name, array $named_params) : string

This will return the FULL url (including the base url and index.php).

WARNING: Reverse routing with routes that contains a regex is still experimental. The simple ones work, but complex ones might fail!

Usage:

Foo

Parameters

$name

string

the name of the route

$named_params

array

the array of named parameters

Returns

stringthe full url for the named route

Processes the given request using the defined routes

process(\Request $request, bool $route) : mixed

Parameters

$request

\Request

the given Request object

$route

bool

whether to use the defined routes or not

Returns

mixedthe match array or false

Checks whether class exists.

check_class(string $class) : bool

Parameters

$class

string

The class name to check.

Exceptions

\Exception

Returns

boolTrue if $class exists, false otherwise.

Get prefix.

get_prefix() : string

Returns

stringPrefix as defined in config controller_prefix.

Find the controller that matches the route requested

parse_match(\Fuel\Core\Route $match) : mixed

Parameters

$match

\Fuel\Core\Route

the given Route object

Returns

mixedthe match array or false

parse_segments()

parse_segments($segments, $namespace, $module) 

Parameters

$segments

$namespace

$module

 Properties

 

$routes

$routes 

 

Defines the controller class prefix.

$prefix 

This allows you to namespace controllers