Skip to content

Instantly share code, notes, and snippets.

@Ponsjuh
Ponsjuh / gist:dc002d6f504cb50974ae
Created June 10, 2015 17:38
ZF2 - Fundamentals - EventManager
public function indexAction()
{
$events = $this->getEventManager();
$events->attach('do', function($e) {
$event = $e->getName();
$target = get_class($e->getTarget());
$params = json_encode($e->getParams());
$params = $e->getParams();
printf("handled event '%s' with params %s", $event, json_encode($params));