Hello,
I need your help with attach event (PHP OOP). I don’t know how to do this:
//This function I have tried inside/outside Class
function doOnAfterAction($action) {
$action->set_response_text(‘lalala’);
}
//how to do this line
$data->event->attach(“AfterUpdate”, doOnAfterAction);
I have tried:
$data->event->attach(“AfterUpdate”, “doOnAfterAction”);
$data->event->attach(“AfterUpdate”, doOnAfterAction);
$data->event->attach(“AfterUpdate”, doOnAfterAction());
$data->event->attach(“AfterUpdate”, $this->doOnAfterAction);
$data->event->attach(“AfterUpdate”, $this->doOnAfterAction());
Always got error "Incorrect function assigned " , “Missing Parameter for $action”
Thanks