I am using Aram's DataobjectAsPage module. Now I want to have a form on every DOaP site. I created such a form in my Dataobject
public function RegistrationForm() {
$fields = new FieldList(
new TextField('Name'),
new TextField('PlusOne')
);
$actions = new FieldList(
new FormAction('doRegistration', 'Submit')
);
return new Form($this, 'RegistrationForm', $fields, $actions);
}
public function doRegistration($data, $form) {
$submission = new RegistrationObject();
$form->saveInto($submission);
$submission->EventObjectID = $this->ID;
$submission->write();
return $this->redirectBack();
}
my Dataobject_show.ss The template is as follows
$RegistrationForm
<% loop Registrations %>
$Name - $PlusOne
<% end_loop %>
There is a form, but no data is sent. The same form works on a regular page, but not on a data object. how can i fix this?
thanks in advance
source
share