Saturday, 19 November 2011 16:45

Lär dig mer om K2 Event

Written by 
Rate this item
(0 votes)

Joomla K2 är fullmatad med olika event som du kan använda dig av vid programmering. Tyvärr kan det vara svårt att hitta information om dessa event i dokumentationen till K2

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

Read 456 times Last modified on Friday, 24 February 2012 15:05
Daniel Eliasson

A programmer and webdesigner with over 15 years of experience in different programming languages with a toolbox consisting of: Objective C, JAVA, C++, PHP and many more techniques.

Leave a comment

Please note that support questions will not be answered in these comments. Use the support forum instead.

Stilero på Twitter

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.

by Daniel Eliasson

Follow Stilero Webdesign


Google+