Keyword

how to insert additional data in the database when creating an item

  • doberk
  • doberk's Avatar Topic Author
  • Offline
  • New Member
More
2 weeks 5 days ago #168633 by doberk
doberk created the topic: how to insert additional data in the database when creating an item
Hello, I would like to load a php script right after save a new item. What I want to do is to insert additional data in the database at the same time the backend save the item information in database. I mean, save button should save the item and also run my script in order to save other data in other table in joomla database.

I was taking a look the the k2 files, but I don't know what file I have to override? Could you help me?

Thanks in advance.

Please Log in or Create an account to join the conversation.

More
2 weeks 3 days ago #168638 by Sambroza
Sambroza replied the topic: how to insert additional data in the database when creating an item
You can do this with a K2 plugin.
Find here an example plugin: github.com/getk2/k2-example-plugin/blob/master/example.php

You can hook your additional actions on the
onAfterK2Save
method.
function onAfterK2Save($row, $isNew)
	{
		// Do something here
	}

Please Log in or Create an account to join the conversation.

  • doberk
  • doberk's Avatar Topic Author
  • Offline
  • New Member
More
2 weeks 3 days ago #168639 by doberk
doberk replied the topic: how to insert additional data in the database when creating an item
Thank you very much, very useful info, I'll try it :)

Please Log in or Create an account to join the conversation.

Moderators: william white