Cake\Controller\Controller::afterFilter PHP Метод

afterFilter() публичный Метод

Called after the controller action is run and rendered.
public afterFilter ( Cake\Event\Event $event ) : Response | null
$event Cake\Event\Event An Event instance
Результат Cake\Network\Response | null
    public function afterFilter(Event $event)
    {
        return null;
    }

Usage Example

Пример #1
1
 /**
  * Generate the response using the controller object.
  *
  * @param string $template The template to render.
  * @return void
  */
 protected function _outputMessage($template)
 {
     try {
         $this->controller->render($template);
         $event = new Event('Controller.shutdown', $this->controller);
         $this->controller->afterFilter($event);
         $this->controller->response->send();
     } catch (MissingViewException $e) {
         $attributes = $e->getAttributes();
         if (isset($attributes['file']) && strpos($attributes['file'], 'error500') !== false) {
             $this->_outputMessageSafe('error500');
         } else {
             $this->_outputMessage('error500');
         }
     } catch (\Exception $e) {
         $this->_outputMessageSafe('error500');
     }
 }
All Usage Examples Of Cake\Controller\Controller::afterFilter