diff --git a/code/TestMultiForm.php b/code/TestMultiForm.php index 1cad3ba..4c45d99 100644 --- a/code/TestMultiForm.php +++ b/code/TestMultiForm.php @@ -19,6 +19,8 @@ class TestMultiForm extends MultiForm { $fields->push(new LiteralField($key . '_copy', "
$key $value
")); } + Session::set("MultiFormMessage", "Your information has been submitted."); + Director::redirect(Director::BaseURL() . $this->Controller()->URLSegment); } } diff --git a/code/TestMultiFormPage.php b/code/TestMultiFormPage.php index fe7d67d..80fb982 100644 --- a/code/TestMultiFormPage.php +++ b/code/TestMultiFormPage.php @@ -10,4 +10,15 @@ class TestMultiFormPage_Controller extends Page_Controller { return $form; } + + function FormMessage() { + if(Session::get('MultiFormMessage')) { + $message = Session::get('MultiFormMessage'); + Session::clear('MultiFormMessage'); + + return $message; + } + + return false; + } } diff --git a/templates/Layout/TestMultiFormPage.ss b/templates/Layout/TestMultiFormPage.ss new file mode 100644 index 0000000..e0d73a3 --- /dev/null +++ b/templates/Layout/TestMultiFormPage.ss @@ -0,0 +1,4 @@ +<% if FormMessage %> + +<% end_if %> +$Form \ No newline at end of file