zendframework/zf2 — pull request #2242 by juriansluiman (2012-08-26 09:09:23+00:00)
Title: Allow null value for route name in PRG plugin

In a lot of PRG patterns the POST request happens to the same url as the GET request. This PR keeps the flexibility to set the route name but it also defaults to the currently matched route name.

Previously I did:

```php
$route = $this->getEvent()->getRouteMatch()->getMatchedRouteName();

if (($result = $this->prg($route)) instanceof Response) {
return $result;
} elseif (false !== $result) {
// Do stuff
}
```

Where now you're able to:

```php
if (($result = $this->prg()) instanceof Response) {
return $result;
} elseif (false !== $result) {
// Do stuff
}
```

Test is made to assert the behaviour.