PHP Class Zaphpa_Router, zaphpa

ファイルを表示 Open project: zaphpa/zaphpa Class Usage Examples

Public Properties

Property Type Description
$middleware

Protected Properties

Property Type Description
$methods Allowed HTTP Methods. Restricted to only common ones, for security reasons. *
$routes

Public Methods

Method Description
addRoute ( $params ) Add a new route to the configured list of routes
attach ( ) Add a new middleware to the list of middlewares
getRequestMethod ( ) Get lower-cased representation of current HTTP Request method
route ( $uri = null )

Protected Methods

Method Description
invoke_callback ( $callback, $params ) Main reason this is a separate function is: in case library users want to change invokation logic, without having to copy/paste rest of the logic in the route() function.
invoke_options ( )

Private Methods

Method Description
getRoutes ( $all = false ) Please note this method is performance-optimized to only return routes for current type of HTTP method

Method Details

addRoute() public method

Add a new route to the configured list of routes
public addRoute ( $params )

attach() public method

Add a new middleware to the list of middlewares
public attach ( )

getRequestMethod() public static method

Get lower-cased representation of current HTTP Request method
public static getRequestMethod ( )

invoke_callback() protected method

Main reason this is a separate function is: in case library users want to change invokation logic, without having to copy/paste rest of the logic in the route() function.
protected invoke_callback ( $callback, $params )

invoke_options() protected method

protected invoke_options ( )

route() public method

public route ( $uri = null )

Property Details

$methods protected_oe static_oe property

Allowed HTTP Methods. Restricted to only common ones, for security reasons. *
protected static $methods

$middleware public_oe static_oe property

public static $middleware

$routes protected_oe property

protected $routes