### Initialize hook
Like Controller and Table, this class has an initialize() hook that you can use
to add custom 'constructor' logic. It is important to remember that each request
(and sub-request) will only make one instance of any given component.
### Life cycle callbacks
Components can provide several callbacks that are fired at various stages of the request
cycle. The available callbacks are:
- beforeFilter(Event $event)
Called before the controller's beforeFilter method by default.
- startup(Event $event)
Called after the controller's beforeFilter method, and before the
controller action is called.
- beforeRender(Event $event)
Called before the Controller beforeRender, and before the view class is loaded.
- shutdown(Event $event)
Called after the action is complete and the view has been rendered but
before Controller::afterFilter().
- beforeRedirect(Event $event $url, Response $response)
Called before a redirect is done. Allows you to change the URL that will
be redirected to by returning a Response instance with new URL set using
Response::location(). Redirection can be prevented by stopping the event
propagation.
While the controller is not an explicit argument for the callback methods it
is the subject of each event and can be fetched using Event::subject().