Hi Jamie,
This is pretty easy. Given the EventManager of an application:
$application->getEventManager()->getSharedManager()->attach('ModuleName',
'dispatch', function ($e) {
echo 'controller ' . get_class($e->getTarget()) . ' dispatched';
});
Marco Pivetta
http://twitter.com/Ocramius
http://ocramius.github.com/
On 22 May 2014 00:29, Jamie Krasnoo <[email protected]> wrote:
> I'm trying to figure out what would be more appropriate when you need to
> run something for every controller and its actions in a Module. Currently I
> have a callback registered to the route event and check the route match
> name for the module name and return if it's not and move forward if it is.
> Is there a better way to do this rather than having something that runs for
> every module looking for that particular module to run or having to put
> repetitive code in every controller?
>
>
> Jamie
>