How can i trigger an event that occurs with the view of a plugin? The event handler should also be within the plugin class.
Can someone help me please.
<?php
class WordBot extends RaxanPlugin {
public static $name = 'WordBbbot';
public static $description = "WordBot plugin";
public static $author = "Raymond";
protected function methods() { return get_class_methods($this); }
public static function register() { return self::instance(__CLASS__); }
protected function page_load($e,$page) {
// bind click event to a public method on the plugin
$page['a.word']->bind('click', array($this,'handler'));
}
// event handler
public function handler($e) {
$page = $e->page(); // get a reference to the page
$page->append('Hello there!');
}
}
WordBot::register();
?>
Users browsing this forum: No registered users and 1 guest