getTarget(); $events = $app->getEventManager(); $events->attach('route', array($this, 'onRoute'), -100); } public function onRoute($e) { $matches = $e->getRouteMatch(); if (!$matches instanceof \Zend\Mvc\Router\RouteMatch) { // No matches == not a match! return; } $controller = $matches->getParam('controller'); if (__NAMESPACE__ != substr($controller, 0, strlen(__NAMESPACE__))) { // Namespace does not match! return; } // Namespace matches! Do something interesting! } }