zendframework/zf2 — pull request #4082 by papayasoft (2013-03-20 08:34:00+00:00)
Title: Allow status code in Redirect::toUrl()

The implementation of the method `Zend\Mvc\Controller\Plugin\Redirect::toUrl()` contains:

```php
public function toUrl($url)
{
$response = $this->getResponse();
$response->headers()->addHeaderLine('Location', $url);
$response->setStatusCode(302);
return $response;
}
```

Sometimes you want a 301 status. So why not make the signature:

```
public function toUrl($url, $code = 302)
```

This PR makes this change and adds unit-tests for default code and custom code setting.