zendframework/zf2 — pull request #4682 by nicktacular (2013-06-18 16:06:14+00:00)
Title: The Redirect plugin now supports a code for the redirect, either 301 or ...

Hi there!

The redirect plugin for controllers needs to be a bit more configureable for redirects. In some cases a 301 redirect is desirable, so I've made a small modification to allow for that. By default, the plugin works as it did before. It issues a 302 (temporary) redirect. All the Mvc tests pass with this modification.

The modification allows you to call the plugin with a second parameter that must be either `\Zend\Http\Response::STATUS_CODE_301` or `\Zend\Http\Response::STATUS_CODE_302` otherwise a `\Zend\Mvc\Exception\InvalidArgumentException` will be thrown.

The associated test changes are also in this commit (runs and passes, woo hoo!).

Note that this is not an API break.

Thank you for your consideration!

Nick