Hoa central
Public Member Functions | Public Attributes | List of all members
Hoa\Router\Router Interface Reference
Inheritance diagram for Hoa\Router\Router:

Public Member Functions

 addRule ($id, Array $methods, $pattern, $call=null, $able=null, Array $variables=[])
 
 addPrivateRule ($id, Array $methods, $pattern, $call=null, $able=null, Array $variables=[])
 
 removeRule ($id)
 
 ruleExists ($id)
 
getTheRule ()
 
 route ()
 
 unroute ($id, Array $variables=[])
 
 getMethod ()
 
 isAsynchronous ()
 

Public Attributes

const VISIBILITY_PUBLIC = 0
 
const VISIBILITY_PRIVATE = 1
 
const RULE_VISIBILITY = 0
 
const RULE_ID = 1
 
const RULE_METHODS = 2
 
const RULE_PATTERN = 3
 
const RULE_CALL = 4
 
const RULE_ABLE = 5
 
const RULE_VARIABLES = 6
 

Detailed Description

Interface .

Router interface.

Definition at line 49 of file Router.php.

Member Function Documentation

Hoa\Router\Router::addPrivateRule (   $id,
Array  $methods,
  $pattern,
  $call = null,
  $able = null,
Array  $variables = [] 
)

Add a private rule.

Parameters
string$idID.
array$methodsMethods.
string$patternPattern.
mixed$callCall (first part).
mixed$ableAble (second part).
array$variablesVariables (default or additional values).
Returns

Implemented in Hoa\Router\Generic.

Hoa\Router\Router::addRule (   $id,
Array  $methods,
  $pattern,
  $call = null,
  $able = null,
Array  $variables = [] 
)

Add a public rule.

Parameters
string$idID.
array$methodsMethods.
string$patternPattern.
mixed$callCall (first part).
mixed$ableAble (second part).
array$variablesVariables (default or additional values).
Returns

Implemented in Hoa\Router\Generic.

Hoa\Router\Router::getMethod ( )

Get method or mode where the router is called.

Returns
string

Implemented in Hoa\Router\Http\Http, and Hoa\Router\Cli.

Here is the caller graph for this function:

& Hoa\Router\Router::getTheRule ( )

Get the selected rule after routing.

Returns
mixed

Implemented in Hoa\Router\Generic.

Here is the caller graph for this function:

Hoa\Router\Router::isAsynchronous ( )

Whether the router is called asynchronously or not.

Returns
bool

Implemented in Hoa\Router\Http\Http, Hoa\Router\Cli, and Hoa\Dispatcher\Test\Unit\MockRouter.

Here is the caller graph for this function:

Hoa\Router\Router::removeRule (   $id)

Remove a rule.

Parameters
string$idID.
Returns
void

Implemented in Hoa\Router\Generic.

Hoa\Router\Router::route ( )

Find the appropriated rule.

Returns
Exceptions

Here is the caller graph for this function:

Hoa\Router\Router::ruleExists (   $id)

Check whether a rule exists.

Parameters
string$idID.
Returns
bool

Implemented in Hoa\Router\Generic.

Hoa\Router\Router::unroute (   $id,
Array  $variables = [] 
)

Unroute a rule (i.e. route()^-1).

Parameters
string$idID.
array$variablesVariables.
Returns
string

Implemented in Hoa\Router\Cli.

Member Data Documentation

const Hoa\Router\Router::RULE_ABLE = 5

Rule bucket: able.

int

Definition at line 105 of file Router.php.

const Hoa\Router\Router::RULE_CALL = 4

Rule bucket: call.

int

Definition at line 98 of file Router.php.

const Hoa\Router\Router::RULE_ID = 1

Rule bucket: ID.

int

Definition at line 77 of file Router.php.

const Hoa\Router\Router::RULE_METHODS = 2

Rule bucket: methods.

int

Definition at line 84 of file Router.php.

const Hoa\Router\Router::RULE_PATTERN = 3

Rule bucket: pattern.

int

Definition at line 91 of file Router.php.

const Hoa\Router\Router::RULE_VARIABLES = 6

Rule bucket: variables (extracted from patterns).

int

Definition at line 112 of file Router.php.

const Hoa\Router\Router::RULE_VISIBILITY = 0

Rule bucket: visibility (please, see the self::VISIBILITY_* constants).

int

Definition at line 70 of file Router.php.

const Hoa\Router\Router::VISIBILITY_PRIVATE = 1

Rule visibility: private.

int

Definition at line 63 of file Router.php.

const Hoa\Router\Router::VISIBILITY_PUBLIC = 0

Rule visibility: public.

int

Definition at line 56 of file Router.php.


The documentation for this interface was generated from the following file: