The following events are available in the Controller package.
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. |
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. |
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. |