getSavedSteps(); $savedData = array(); foreach($savedSteps as $step) { $savedData = array_merge($savedData, $step->loadData()); } $fields = new FieldSet(); $fields->push(new LiteralField("Heading", "

You have submitted the following information:

")); foreach($savedData as $key=>$value) { $fields->push(new LiteralField($key . '_copy', "

$key $value

")); } Session::set("MultiFormMessage", "Your information has been submitted."); Director::redirect(Director::BaseURL() . $this->Controller()->URLSegment); } } class TestMultiFormStepOne extends MultiFormStep { protected static $next_steps = 'TestMultiFormStepTwo'; function getFields() { return new FieldSet( new TextField('FirstName', 'First name'), new TextField('Surname', 'Surname') ); } } class TestMultiFormStepTwo extends MultiFormStep { protected static $next_steps = 'TestMultiFormStepThree'; function getFields() { return new FieldSet( new TextField('Email', 'Email'), new TextField('Address', 'Address') ); } } class TestMultiFormStepThree extends MultiFormStep { protected static $is_final_step = true; function getFields() { $form = $this->getForm(); $savedSteps = $form->getSavedSteps(); $savedData = array(); foreach($savedSteps as $step) { $savedData = array_merge($savedData, $step->loadData()); } $fields = new FieldSet(); $fields->push(new LiteralField("Heading", "

You have submitted the following information:

")); foreach($savedData as $key=>$value) { if(preg_match("/_copy$/", $key)) continue; $fields->push(new LiteralField($key . '_copy', "

$key $value

")); } return $fields; } }