I feel like I'm too obsessed with cleaning and refactoring code.But when I look at the code a couple of months later I know it was worth it.
K2 Backend events
Dessa event triggas backend eller via administratörsidan som det också kallas.
Item
Event som triggas vid ändring och skapande av artiklar och innehåll till K2
onBeforeK2Save
This event is called before the content is saved to the database
Parameters
- row - A reference to the K2 item object
- isNew - Boolean value to show is the item is new
Return value
Boolean
onAfterK2Save
This event is called Afterthe content is saved to the database
Parameters
- row - A reference to the K2 item object
- isNew - Boolean value to show is the item is new
Return value
None
onK2BeforeDownload
This event is called before an attachment is downloaded
Parameters
- attachment - A reference to the K2 attachment object
- params - attachment parameters
Return value
none
onK2AfterDownload
This event is called after an attachment is downloaded
Parameters
- attachment - A reference to the K2 attachment object
- params - attachment parameters
Return value
none
Where do I find more events?
Every model contains specific events that you can use. Search for the phrase $dispatcher->trigger to find new events.
The models are located in the folder administrator->components->com_k2->models