Joomla 3 Module Save Event

by F.F   Last Updated August 21, 2015 17:04 PM

I am searching for an event that is triggered after saved a specific Module, for a Plugin. Like the onContentAfterSave Event for the Content Group.

Is there such an Event, or how can I trigger such an event after save?

Answers 1

On the module you should create a dispatcher in its save method like this:

$dispatcher = JEventDispatcher::getInstance();
$dispatcher->trigger( 'onAfterMyModuleSave', array( $myModuleData, $insertid ) );

You can include any kind of data that you would like to handle in your plugin with an array like the example.

Then at your plugin you have to create a "listener" like this:

public function onAfterMyModuleSave($data, $id)
  //do what you like here

Of course I recommend you first to check for any existing dispatchers in the module

August 23, 2015 21:36 PM

Related Questions

Custom Module - Subform get file type

Updated April 19, 2018 15:10 PM

Set default module style in template

Updated May 23, 2018 16:10 PM

How to get article id on BT CONTENT SLIDER?

Updated November 13, 2017 14:10 PM