Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagephp
title/install_dir/plugins/my_plugin.php
<?php
class MyPlugin extends Plugin {

	...

	public function getEvents() {
		return array(
			array(
				'event' => "preaction",
				'callback' => array("this", "run")
			)
			// Add multiple events here
		);
	}

	public function run() {
		// This will execute withwhen the "preaction" event is triggered
	}
}
?>

...