PHP Class RKA\Slim

Inheritance: extends Slim\Slim
Show file Open project: akrabat/rka-slim-controller Class Usage Examples

Public Methods

Method Description
mapRoute ( $args ) : Slim\Route Add a route as per the parent method, additionally supporting the syntax "{controller class name}:{action method name}" as the last argument which will be converted to a closure that instantiates the controller (or gets from container) and then calls the method on it.

Protected Methods

Method Description
createControllerClosure ( string $name ) : closure Create a closure that instantiates (or gets from container) and then calls the action method.

Method Details

createControllerClosure() protected method

Also if the methods exist on the controller class, call setApp(), setRequest() and setResponse() passing in the appropriate object.
protected createControllerClosure ( string $name ) : closure
$name string controller class name and action method name separated by a colon
return closure

mapRoute() public method

Add a route as per the parent method, additionally supporting the syntax "{controller class name}:{action method name}" as the last argument which will be converted to a closure that instantiates the controller (or gets from container) and then calls the method on it.
public mapRoute ( $args ) : Slim\Route
return Slim\Route