PHP Class Roller\Router

Show file Open project: c9s/roller Class Usage Examples

Public Properties

Property Type Description
$cache * boolean, is cache enabled ?
$cacheDir cache directory
$cacheExpiry cache exxpiry
$cacheId cache id
$extensionSupport
$hasCache is cache found ?
$matchedRouteClass
$plugins plugins
$reload should we reload cache ? (not implemented yet)
$routes

Public Methods

Method Description
__call ( $m, $a ) dispatch methods to plugins (mixin) and routeset methods
__construct ( $routes = null, $options = [] )
add ( $path, $callback, $options = [] )
addPlugin ( $plugin )
any ( $path, $callback, $options = [] )
dispatch ( $path )
get ( $path, $callback, $options = [] ) We define get, post, any methods because __call is slower (2 times)
mount ( $prefix, $routeset )
post ( $path, $callback, $options = [] )

Private Methods

Method Description
makeCache ( )

Method Details

__call() public method

dispatch methods to plugins (mixin) and routeset methods
public __call ( $m, $a )

__construct() public method

public __construct ( $routes = null, $options = [] )

add() public method

public add ( $path, $callback, $options = [] )

addPlugin() public method

public addPlugin ( $plugin )

any() public method

public any ( $path, $callback, $options = [] )

dispatch() public method

public dispatch ( $path )

get() public method

We define get, post, any methods because __call is slower (2 times)
public get ( $path, $callback, $options = [] )

mount() public method

public mount ( $prefix, $routeset )

post() public method

public post ( $path, $callback, $options = [] )

Property Details

$cache public property

* boolean, is cache enabled ?
public $cache

$cacheDir public property

cache directory
public $cacheDir

$cacheExpiry public property

cache exxpiry
public $cacheExpiry

$cacheId public property

cache id
public $cacheId

$extensionSupport public property

public $extensionSupport

$hasCache public property

is cache found ?
public $hasCache

$matchedRouteClass public property

public $matchedRouteClass

$plugins public property

plugins
public $plugins

$reload public property

should we reload cache ? (not implemented yet)
public $reload

$routes public property

public $routes