Hey everyone!
This is my custom form:
class PatientFormMC01 extends Form {
function __construct($controller, $name) {
$fields = new FieldSet(
new TextField("Field1", "Field 1"),
new TextField("Field2", "Field 2")
);
$actions = new FieldSet(
new FormAction("doForm", "Submit")
);
$validator = new RequiredFields(
"Field1", "Field2"
);
parent::__construct($controller, $name, $fields, $actions, $validator);
}
function doForm($data, $form) {
//
Director::redirectBack();
}
}
And I call it using:
function Form(){.....
return new PatientFormMC01($this, "Form");
.....
}
But I am getting:
Fatal error: Call to a member function loadDataFrom() on a non-object in ...sapphire/core/control/Controller.php on line 178
Using SS 2.2.3