Zend\Mvc\MvcEvent::getControllerClass PHP Method

getControllerClass() public method

Get controller class
public getControllerClass ( ) : string
return string
    public function getControllerClass()
    {
        return $this->getParam('controller-class');
    }

Usage Example

 public function onError(MvcEvent $event)
 {
     // if error has been removed
     if ($event->isError() == false) {
         return;
     }
     $locator = $event->getApplication()->getServiceManager();
     /* @var $errorService \BitWeb\ErrorReporting\Service\ErrorService */
     $errorService = $locator->get('BitWeb\\ErrorReporting\\Service\\ErrorService');
     $exception = $event->getParam('exception');
     $error = $event->getError();
     $stopPropagation = false;
     if ($exception instanceof \Exception) {
         $errorService->errors[] = $exception;
         if ($exception instanceof \PDOException) {
             $stopPropagation = true;
         }
     } elseif ($error != null) {
         $errorService->errors[] = new RouterNoMatchException(sprintf('%1$s, %2$s', $error, $event->getControllerClass()));
     }
     if ($stopPropagation) {
         $this->onFinishAfterPostDispatch($event);
     }
 }
All Usage Examples Of Zend\Mvc\MvcEvent::getControllerClass