fabpot/Silex — Issue #193: Examples not working
Author: cj
Created: 2011-10-21 13:37:23+00:00
State: open

Hi,

The examples at http://silex.sensiolabs.org/doc/usage.html#route-variables-converters do not work. For instance:

```
$callback = function ($post, Request $request) {
return new Post($request->attributes->get('slug'));
};

$app->get('/blog/{id}/{slug}', function (Post $post) {
// ...
})->convert('post', $callback);
```

Throws errors like:

```
Catchable fatal error: Argument 2 passed to {closure}() must be an instance of Request, instance of Symfony\Component\HttpFoundation\Request
```
and
```
ReflectionException: Class Post does not exist
```

I have them working with out including ```Request``` and ```Post``` but shouldn't they work with?