Constants

CONTROLLER_NAMESPACE

CONTROLLER_NAMESPACE

Pretty self-explanatory, isn't it?

PREG_DELIMITER

PREG_DELIMITER

Delimiter used in the regex checking

Properties

$server_name

$server_name : string

The server name

Type

string

$server_addr

$server_addr : string

The server IP

Type

string

$port

$port : integer

The port in use

Type

integer

$remote_addr

$remote_addr : string

The remote address

Type

string

$request_scheme

$request_scheme : string

The request scheme

Type

string

$path

$path : string

The raw path info

Type

string

$request_method

$request_method : string

Request method in use

Type

string

$controller

$controller : string

Controller name

Type

string

$method

$method : string

Method name

Type

string

$method_args

$method_args : array

Arguments to pass on to the method

Type

array

$err_controller

$err_controller : string

The error controller name

Type

string

$default_controller

$default_controller : string

The default controller

Type

string

$routes

$routes : array

The routes array

Type

array

$is_cli_request

$is_cli_request : boolean

Whether we're dealing with a CLI request.

..

Type

boolean

$is_ajax_request

$is_ajax_request : boolean

Whether we're dealing with an AJAX request

Type

boolean

Methods

initNoCall()

initNoCall() : \Alo\Controller\Router

Same as init(), but without attempting to call the controller

Returns

\Alo\Controller\Router

is_cli_request()

is_cli_request() : boolean

Returns whether this is a CLI request

Returns

boolean

is_ajax_request()

is_ajax_request() : boolean

Returns whether this is an AJAX request

Returns

boolean

getErrController()

getErrController() : string

Returns the error controller name

Returns

string

getMethod()

getMethod() : string

Returns the controller method name

Returns

string

getController()

getController() : string

Returns the controller name

Returns

string

getPort()

getPort() : integer

Returns the request port used

Returns

integer

getRemoteAddr()

getRemoteAddr() : string

Returns the request remote IP

Returns

string

getRequestMethod()

getRequestMethod() : string

Returns the request method used

Returns

string

getRequestScheme()

getRequestScheme() : string

Returns the request scheme used

Returns

string

getServerAddr()

getServerAddr() : string

Returns the server internal IP

Returns

string

getServerName()

getServerName() : string

Returns the server name

Returns

string

getPath()

getPath() : string

Returns the request path

Returns

string

__toString()

__toString() : string

Returns a string representation of the object data

Returns

string

forceError()

forceError(string  $msg = null) : \Alo\Controller\Router

Forces the error controller

Parameters

string $msg

Optionally, the error message thrown by ReflectionClass or ReflectionMethod

Throws

\Alo\Exception\ControllerException

If the controller is already the error controller

Returns

\Alo\Controller\Router

tryCall()

tryCall() : \Alo\Controller\Router

Tries to call the appropriate class' method

Throws

\Alo\Exception\ControllerException

When the class/method is unavailable and the error controller is invalid

Returns

\Alo\Controller\Router

resolvePath()

resolvePath() : \Alo\Controller\Router

Resolves the controller/method path

Returns

\Alo\Controller\Router

init_routes()

init_routes() : \Alo\Controller\Router

Initialises the routing variables

Throws

\Alo\Exception\ControllerException

When the config file is not found

\Alo\Exception\ControllerException

When $error_controller_class is not present in the config file

\Alo\Exception\ControllerException

When $routes[':default'] is not present

\Alo\Exception\ControllerException

When $routes is not a valid array

\Alo\Exception\ControllerException

When a route value is not a string

Returns

\Alo\Controller\Router

init_path()

init_path() : \Alo\Controller\Router

Initialises the raw path variable

Returns

\Alo\Controller\Router

init_server_vars()

init_server_vars() : \Alo\Controller\Router

Initialises most server variables

Returns

\Alo\Controller\Router