Fruit RouteKit
Route kit of Fruit Framework
Public Member Functions
Mux Class Reference
Inheritance diagram for Mux:
Router

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= ' ')
 

Detailed Description

Mux is where you place routing rules and dispatch request according to these rules.

Definition at line 14 of file Mux.php.

Constructor & Destructor Documentation

__construct ( )

Definition at line 19 of file Mux.php.

Member Function Documentation

any (   $path,
  $handler,
array  $constructorArgs = null 
)

Definition at line 107 of file Mux.php.

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.

Parameters
$clsNamestring custom class name, default to 'FruitRouteKitGeneratedMux'.
$indentstring how you indent generated class.

Definition at line 210 of file Mux.php.

delete (   $path,
  $handler,
array  $constructorArgs = null 
)

Definition at line 97 of file Mux.php.

dispatch (   $method,
  $url 
)

Calling right handler/controller according to http method and request uri.

Parameters
$methondstring of http request method, case insensitive.
$urlstring of request uri
Returns
whatever you return in the handler/controller, or an exception if no rule matched.

Implements Router.

Definition at line 37 of file Mux.php.

dot ( )

Generate graphviz dot diagram

Definition at line 120 of file Mux.php.

get (   $path,
  $handler,
array  $constructorArgs = null 
)

Definition at line 82 of file Mux.php.

option (   $path,
  $handler,
array  $constructorArgs = null 
)

Definition at line 102 of file Mux.php.

post (   $path,
  $handler,
array  $constructorArgs = null 
)

Definition at line 87 of file Mux.php.

put (   $path,
  $handler,
array  $constructorArgs = null 
)

Definition at line 92 of file Mux.php.

setInterceptor ( Interceptor  $int)

Definition at line 24 of file Mux.php.


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