I'm trying to write a hook extension. I have .php file which has:
// Load this php code.
$wgAutoloadClasses['AddImages'] = $dir . 'AddImages.body.php';
//Hooks
$wgHooks['EditPage::showEditForm:fields'][] = 'AddImages::fnAddImages';
Then in AddImages.body.php I have the class and functions
Class AddImages{
function form(){
//some php code
}
function fnAddImages(){
global $wgOut, $wgHooks, $wgUser;
// some code $call form = form();
$wgOut -> $call form;
return true;
}
}
My issue is I need to call another function eg form() within fnAddImages() but when I try to I get the message: Fatal error: Call to undefined function form();
How to I call other functions in the class besides for the 'hooked' function? Am I missing something about understanding hooks? I need to output other data (form submission) besides for just returning true on the hooked function. I thought I would do this by calling other functions within the hook. Is there a better way to do this? Thanks, I'm really stuck on this.