protected function _shutdown()
    {
        $this->controller->dispatchEvent('Controller.shutdown');
        $dispatcher = DispatcherFactory::create();
        $eventManager = $dispatcher->getEventManager();
        foreach ($dispatcher->filters() as $filter) {
            $eventManager->on($filter);
        }
        $args = [
            'request' => $this->controller->request,
            'response' => $this->controller->response
        ];
        $result = $dispatcher->dispatchEvent('Dispatcher.afterDispatch', $args);

        return $result->getData('response');
    }
protected function _shutdown()
    {
        $this->controller->dispatchEvent('Controller.shutdown');
        $dispatcher = DispatcherFactory::create();
        $eventManager = $dispatcher->getEventManager();
        foreach ($dispatcher->filters() as $filter) {
            $eventManager->on($filter);
        }
        $args = [
            'request' => $this->controller->request,
            'response' => $this->controller->response
        ];
        $result = $dispatcher->dispatchEvent('Dispatcher.afterDispatch', $args);

        return $result->getData('response');
    }
protected function _shutdown ( ) { $ this -> controller -> dispatchEvent ( 'Controller.shutdown' ) ; $ dispatcher = DispatcherFactory :: create ( ) ; $ eventManager = $ dispatcher -> getEventManager ( ) ; foreach ( $ dispatcher -> filters ( ) as $ filter ) { $ eventManager -> on ( $ filter ) ; } $ args = [ 'request' => $ this -> controller -> request , 'response' => $ this -> controller -> response ] ; $ result = $ dispatcher -> dispatchEvent ( 'Dispatcher.afterDispatch' , $ args ) ; return $ result -> getData ( 'response' ) ; }
Run the shutdown events.

Triggers the afterFilter and afterDispatch events.

@return \Cake\Http\Response The response to serve.
Run the shutdown events .