Example #1
0
 /**
  * @internal
  */
 public function onRoute(\Zend\EventManager\EventInterface $e)
 {
     // Validate loglevel value. Invalid content will cause the route to fail
     // and trigger the usage message.
     $logLevel = $e->getRouteMatch()->getParam('loglevel');
     if ($logLevel != '' and !\Zend\Validator\StaticValidator::execute($logLevel, 'Library\\LogLevel')) {
         $e->setError(\Zend\Mvc\Application::ERROR_ROUTER_NO_MATCH);
         $e->setName(\Zend\Mvc\MvcEvent::EVENT_DISPATCH_ERROR);
         $e->getTarget()->getEventManager()->triggerEvent($e);
     }
 }