Properties

$_routes

$_routes : array

where the routes are stored

Type

array

$_request_args

$_request_args : object

stores the request uri and post and get args

Type

object

Methods

__construct()

__construct()

init()

init()

addRoute()

addRoute(string $name, string $url, string $controller, string $method,  $callback) : bool

adds a temporary route to the routes

Parameters

string $name
  • name of the route
string $url
  • the route itself
string $controller
  • name of the controller
string $method
  • name of the method to call
$callback

Returns

bool

getRoute()

getRoute(string $name) : array

returns a given route if it is set

Parameters

string $name
  • name of the route to return

Returns

array

matchRoute()

matchRoute(string $uri,  $matchcallbacks) : array

looks for a matching route in the set routes

Parameters

string $uri
  • uri to check
$matchcallbacks

Returns

array —
  • empty if nothing found, otherwise full of good stuff

url()

url(string $route, array $vars,  $add_base) : string

returns a url string, based on the routes url but with with placeholders replaced

Parameters

string $route
  • name of route to get url for
array $vars
  • vars to use instead of placeholders
$add_base

Returns

string

findRoute()

findRoute(array $request) : array

checks to see if a route matches the incoming request checks through the _routes array, to see if something matches

Parameters

array $request

Returns

array

controllerClassnameForString()

controllerClassnameForString(string $name) : string

find the name of the controller to be called, given the first part of the request string

Parameters

string $name

first part of request

Returns

string —

controller classname

getRequestAndArgs()

getRequestAndArgs() : object

returns the request uri plus arguments from get and post

Returns

object

translate()

translate(\unknown_type $name) : \unknown

replace the first part of the request by something else.

Parameters

\unknown_type $name

Returns

\unknown

defaultControllerClassname()

defaultControllerClassname() : string

if no controller fits the request, use a RoxController

Returns

string —

classname of the default controller

loadRoutingAliasTable()

loadRoutingAliasTable()

iniParse()

iniParse( $file,  $alias_table)

Parameters

$file
$alias_table

iniWrite()

iniWrite( $file,  $alias_table)

Parameters

$file
$alias_table