Once I process my form submission I'd like to redirect to a child page of the form.
I'm sure I'm just missing something simple here.
I'm trying this (and many variations of):
function doSignup($data, $form) {
$submission = new LandingFormSubmission();
$form->saveInto($submission);
$submission->write();
Director::redirect($this->Children()->First()->Link());
}
EDIT:
This isn't the first time this has happened to me. Shame on me. I forgot that this page was "Not shown in menu" so Children() was empty.
The director should have been:
Director::redirect($this->AllChildren()->First()->Link());
Note to anyone else looking at this. If your page is not shown in the menu(Behavior tab), then you have to use AllChildren(), not Children().
Chris.b