Hooking into an event in Blesta consists merely filling in a stubbed callback method. Blesta offers a number of events that are automatically triggered when needed. These events may be found in the /installdir/components/events/ directory.
In some cases, for example when writing a plugin, you may wish to execute a custom event within the scope of your plugin. For instance, if your plugin allows for the creation of invoices, you may wish to execute an event when an invoice is created. For details on custom events see the Creating Events section of this manual.
Events
Event | Triggered When | Triggered In | Default Event Handler |
---|---|---|---|
AppController.preAction | A URI is requested | AppController:reAction()
| EventsAppControllerCallback:reaction() |
Users.Login | A user logs in | Users::login() | EventsUsersCallback::login() |
Users.Logout | A user logs out | Users::logout() | EventsUsersCallback::logout() |