c9s/Pux — pull request #56 by bearlikelion (2014-06-30 16:45:18+00:00)
Title: Fixed default parameters not being passed to Controller Functions

I ran into an issue with Pux where route parameters weren't properly being passed to Controller functions.

The following example would not return 'Hello World', but instead simply return 'Hello '
```php
$routes->add('/hello/:name',
['Hello', 'world'],
['default' => ['name' => 'world']]
);

class Hello
{
public function world($name)
{
return 'Hello ' . ucfirst($name);
}
}

```

If I would define the world($name = 'world') then it would properly display, but settings defaults in the function as well as the route was redundant. Looking into the executor class I noticed that the $route['default'] wasn't properly set, instead the Mux dispatcher always set variables/options/parameters in the $route[3] array. Changing the default check to look for $route[3]['default'] made the router effortlessly pass default values to Controller functions.

Now with the same route as before, hitting /hello return 'Hello World'