PHP Class System\Route

Afficher le fichier Open project: rwarasaurus/nano Class Usage Examples

Méthodes publiques

Свойство Type Description
$args array The collected arguments from the uri match
$callbacks array Array of callable functions
$collection array Array of collection actions

Méthodes publiques

Méthode Description
__callStatic ( $method, $arguments ) Define a route using the method name as the request method to listen for
__construct ( $callbacks, $args = [] ) Create a new instance of the Route class
action ( $name, $callback ) Register a action on the router
after ( $response ) : object | null Calls after actions
before ( ) : object | null Calls before actions
callback ( $name ) : object | null Run actions
collection ( $actions, $definitions ) Start a collection of routes with common actions
not_found ( $callbacks ) Register the 404 not found callback
register ( $method, $patterns, $arguments ) Register a route on the router
run ( ) : object Calls the route actions and returns a response object

Method Details

__callStatic() public static méthode

Define a route using the method name as the request method to listen for
public static __callStatic ( $method, $arguments )

__construct() public méthode

Create a new instance of the Route class
public __construct ( $callbacks, $args = [] )

action() public static méthode

Register a action on the router
public static action ( $name, $callback )

after() public méthode

Calls after actions
public after ( $response ) : object | null
Résultat object | null

before() public méthode

Calls before actions
public before ( ) : object | null
Résultat object | null

callback() public méthode

Run actions
public callback ( $name ) : object | null
Résultat object | null

collection() public static méthode

Start a collection of routes with common actions
public static collection ( $actions, $definitions )

not_found() public static méthode

Register the 404 not found callback
public static not_found ( $callbacks )

register() public static méthode

Register a route on the router
public static register ( $method, $patterns, $arguments )

run() public méthode

Calls the route actions and returns a response object
public run ( ) : object
Résultat object

Property Details

$args public_oe property

The collected arguments from the uri match
public array $args
Résultat array

$callbacks public_oe property

Array of callable functions
public array $callbacks
Résultat array

$collection public_oe static_oe property

Array of collection actions
public static array $collection
Résultat array