public function injectAccessDeniedViewModel(MvcEvent $event)
    {
        $this->config($event);
        
        $result = $event->getResult();
        
        if ($result instanceof ResponseInterface) {
            return;
        }
        
        $response = $event->getResponse();
        
        if ($response->getStatusCode() != 403) {
            return;
        }
        
        $model = new ViewModel();
        $model->setTemplate($this->template);
        
        if ($this->renderLayout == true) {
            $layout = $event->getViewModel();
            $layout->addChild($model);
        } else {
            $model->setTerminal(true);
            $event->setViewModel($model);
        }
    }
public function injectAccessDeniedViewModel(MvcEvent $event)
    {
        $this->config($event);
        
        $result = $event->getResult();
        
        if ($result instanceof ResponseInterface) {
            return;
        }
        
        $response = $event->getResponse();
        
        if ($response->getStatusCode() != 403) {
            return;
        }
        
        $model = new ViewModel();
        $model->setTemplate($this->template);
        
        if ($this->renderLayout == true) {
            $layout = $event->getViewModel();
            $layout->addChild($model);
        } else {
            $model->setTerminal(true);
            $event->setViewModel($model);
        }
    }
public function injectAccessDeniedViewModel ( MvcEvent $ event ) { $ this -> config ( $ event ) ; $ result = $ event -> getResult ( ) ; if ( $ result instanceof ResponseInterface ) { return ; } $ response = $ event -> getResponse ( ) ; if ( $ response -> getStatusCode ( ) != 403 ) { return ; } $ model = new ViewModel ( ) ; $ model -> setTemplate ( $ this -> template ) ; if ( $ this -> renderLayout == true ) { $ layout = $ event -> getViewModel ( ) ; $ layout -> addChild ( $ model ) ; } else { $ model -> setTerminal ( true ) ; $ event -> setViewModel ( $ model ) ; } }
Inject access denied View Model is response status is 403

@param MvcEvent $event
Inject access denied View Model is response status is 403