dannykopping/Slim — comment on commit 9a8396cba840b6dff0fa631b61b0f979f10c01ef
File:  line 0
By dannykopping:

Here is an example of how to use this new functionality:

```php
$app->customRouter(function($callable, $params) {

$app = Slim::getInstance();

if(!is_callable($callable))
return false;

$result = call_user_func_array($callable, array(array("name" => "Danny")));

if(empty($result))
return false;

$app->contentType("application/json");
$app->response()->header("Access-Control-Allow-Origin", "*");

echo json_encode($result);
return true;
}
);
```