zendframework/zf2 — pull request #1362 by SocalNick (2012-05-23 21:46:13+00:00)
Title: Hotfix: Three fixes having to do with the Forward plugin

First, we need to set the event on the controller as the ControllerLoader doesn't do this for us.

Cloning the event in the Forward plugin protects the original event from changes that happen when we dispatch to the forward controller, namely the target of the original event being changed to the forward controller. Also, since we are cloning, there's no need to cache the routeMatch.

In the ControllerLoaderFactory, the reason for the clone is so that each controller gets it's own plugin broker. In the case where the Forward plugin is being used, a shared plugin broker would get it's internal controller variable overwritten by each Forward.