zendframework/zf2 — pull request #2050 by juriansluiman (2012-07-30 19:05:11+00:00)
Title: Inject controller in controller plugin every time a plugin is retrieved

This fixes [ZF2-433](http://framework.zend.com/issues/browse/ZF2-433).

The following bug is solved with this PR:
```
class FooController
{
public function indexAction()
{
$id = $this->params('id'); // Eg, this is "123"

return $this->forward()->dispatch('BarController', array('action' => 'index', 'id' => '456'));
}
}

class BarController
{
public function indexAction()
{
$id = $this->params('id'); // This is now "123" and NOT "456"

$id = $this->getEvent()->getRouteMatch()->getParam('id'); // This is now "456"
}
}
```

Tests are attached to ensure behaviour is now correctly. A third test is attached to test validation of plugins, not really something of this PR, but makes the plugin manager a bit more tested (as nothing existed yet).

[![Build Status](https://secure.travis-ci.org/juriansluiman/zf2.png?branch=hotfix/controller-plugin)](http://travis-ci.org/#!/juriansluiman/zf2/builds/1993367)