Skip to content

Latest commit

 

History

History
113 lines (103 loc) · 3.31 KB

File metadata and controls

113 lines (103 loc) · 3.31 KB

Events

The following events are available in the Controller package.

controller.processing

The controller.processing event, represented by Titon\Controller\Event\ProcessingEvent, is triggered before the action is executed in dispatchTo().

Argument Type Getter Setter Description
Controller Titon\Controller\Controller getController() The controller in which the action is located and is doing the dispatching.
Action string getAction() The action being dispatched.
Arguments Titon\Controller\ArgumentList getArguments() The arguments to pass to the action.

controller.processed

The controller.processed event, represented by Titon\Controller\Event\ProcessedEvent, is triggered after the action has been executed in dispatchTo(), but before the response is returned. The response can be modified or replaced from this event.

Argument Type Getter Setter Description
Controller Titon\Controller\Controller getController() The controller in which the action is located and is doing the dispatching.
Action string getAction() The action being dispatched.
Response Psr\Http\Message\OutgoingResponseInterface getResponse() setResponse() The HTTP response object in which the action output was set to.

controller.error

The controller.error event, represented by Titon\Controller\Event\ErrorEvent, is triggered when the controllers renderError() method is called.

Argument Type Getter Setter Description
Controller Titon\Controller\Controller getController() The controller in which the error occurred.
Exception Titon\Http\Exception\HttpException getException() The exception thrown to trigger the error.