Fruit RouteKit
Route kit of Fruit Framework
|
Public Member Functions | |
__construct () | |
setInterceptor (Interceptor $int) | |
dispatch ($method, $url) | |
get ($path, $handler, array $constructorArgs=null) | |
post ($path, $handler, array $constructorArgs=null) | |
put ($path, $handler, array $constructorArgs=null) | |
delete ($path, $handler, array $constructorArgs=null) | |
option ($path, $handler, array $constructorArgs=null) | |
any ($path, $handler, array $constructorArgs=null) | |
dot () | |
compile ($clsName= '', $indent= ' ') | |
Mux is where you place routing rules and dispatch request according to these rules.
compile | ( | $clsName = '' , |
|
$indent = ' ' |
|||
) |
Generate static router, convert every dynamic call to handler/controller to static call.
This method will generate the defination of a customed class, which implements Fruit, so you can create an instance and use the dispatch() method.
$clsName | string custom class name, default to 'FruitRouteKitGeneratedMux'. |
$indent | string how you indent generated class. |
dispatch | ( | $method, | |
$url | |||
) |
Calling right handler/controller according to http method and request uri.
$methond | string of http request method, case insensitive. |
$url | string of request uri |
Implements Router.
setInterceptor | ( | Interceptor | $int | ) |