Zend\Mvc\Application::getMvcEvent PHP Method

getMvcEvent() public method

Get the MVC event instance
public getMvcEvent ( ) : MvcEvent
return MvcEvent
    public function getMvcEvent()
    {
        return $this->event;
    }

Usage Example

 /**
  * @return Response
  */
 public function __invoke()
 {
     $routeMatch = $this->application->getMvcEvent()->getRouteMatch();
     $redirect = $this->getRedirect($routeMatch->getMatchedRouteName(), $this->getRedirectRouteFromRequest());
     $response = $this->application->getResponse();
     $response->getHeaders()->addHeaderLine('Location', $redirect);
     $response->setStatusCode(302);
     return $response;
 }
All Usage Examples Of Zend\Mvc\Application::getMvcEvent