From 99d4892e25dcb26b30e0fd608263dc50333220e7 Mon Sep 17 00:00:00 2001 From: Saophalkun Ponlu Date: Thu, 4 Mar 2010 02:36:29 +0000 Subject: [PATCH] MINOR: added successful multiform submission message --- code/TestMultiForm.php | 2 ++ code/TestMultiFormPage.php | 11 +++++++++++ templates/Layout/TestMultiFormPage.ss | 4 ++++ 3 files changed, 17 insertions(+) create mode 100644 templates/Layout/TestMultiFormPage.ss 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 %> +

$FormMessage

+<% end_if %> +$Form \ No newline at end of file