Symfony事件类型

原创
2013/03/18 22:53
阅读数 126

REQUEST The REQUEST event occurs at the very beginning of request dispatching

This event allows you to create a response for a request before any other code in the framework is executed. The event listener method receives a Symfony\Component\HttpKernel\Event\GetResponseEvent instance.

EXCEPTION The EXCEPTION event occurs when an uncaught exception appears

This event allows you to create a response for a thrown exception or to modify the thrown exception. The event listener method receives a Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent instance.

VIEW The VIEW event occurs when the return value of a controller is not a Response instance

This event allows you to create a response for the return value of the controller. The event listener method receives a Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent instance.

CONTROLLER The CONTROLLER event occurs once a controller was found for handling a request

This event allows you to change the controller that will handle the request. The event listener method receives a Symfony\Component\HttpKernel\Event\FilterControllerEvent instance.

RESPONSE The RESPONSE event occurs once a response was created for replying to a request

This event allows you to modify or replace the response that will be replied. The event listener method receives a Symfony\Component\HttpKernel\Event\FilterResponseEvent instance.

TERMINATE The TERMINATE event occurs once a response was sent

This event allows you to run expensive post-response jobs. The event listener method receives a Symfony\Component\HttpKernel\Event\PostResponseEvent instance.

展开阅读全文
打赏
0
0 收藏
分享
加载中
更多评论
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部