Issue with beforeRender

I’m doing a form load, which works if I comment out

//$form->event->(“beforeRender”,“format_Output”);

However, I get '' in my text output as that’s how it’s stored in the mysql database. I’m trying format the output with stripslashes before rendering but nothing is rendered using the below code and the log file is empty.

please help. thanks.

my code:

require_once('config.php');	
require_once('connector/form_connector.php');

function format_Output($dataItem){

$subj=$dataItem->get_value("subject");
$mess=$dataItem->get_value("message");

$subjt = stripslashes(htmlentities($subj, ENT_QUOTES));
$messg = stripslashes(htmlentities($mess, ENT_QUOTES));

$dataItem->set_value("subject",$subjt);
$dataItem->set_value("name",$messg);

}

// sleep(1);
$form = new FormConnector($conn, “MySQL”);
$form->event->(“beforeRender”,“format_Output”);
$form->enable_log(“log.txt”,true);
$form->render_table(“messages”,“messagesid”,“message,subject”);

$form->event->("beforeRender","format_Output");

must be

$form->event->attach("beforeRender","format_Output");

ah, thank you. all good now.