mirror of
https://github.com/silverstripe/silverstripe-frameworktest
synced 2024-10-22 11:06:02 +02:00
MINOR: added successful multiform submission message
This commit is contained in:
parent
26559b06f5
commit
99d4892e25
@ -19,6 +19,8 @@ class TestMultiForm extends MultiForm {
|
|||||||
$fields->push(new LiteralField($key . '_copy', "<p><strong>$key</strong> $value</p>"));
|
$fields->push(new LiteralField($key . '_copy', "<p><strong>$key</strong> $value</p>"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Session::set("MultiFormMessage", "Your information has been submitted.");
|
||||||
|
|
||||||
Director::redirect(Director::BaseURL() . $this->Controller()->URLSegment);
|
Director::redirect(Director::BaseURL() . $this->Controller()->URLSegment);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,4 +10,15 @@ class TestMultiFormPage_Controller extends Page_Controller {
|
|||||||
|
|
||||||
return $form;
|
return $form;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function FormMessage() {
|
||||||
|
if(Session::get('MultiFormMessage')) {
|
||||||
|
$message = Session::get('MultiFormMessage');
|
||||||
|
Session::clear('MultiFormMessage');
|
||||||
|
|
||||||
|
return $message;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
4
templates/Layout/TestMultiFormPage.ss
Normal file
4
templates/Layout/TestMultiFormPage.ss
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<% if FormMessage %>
|
||||||
|
<p class="message">$FormMessage</p>
|
||||||
|
<% end_if %>
|
||||||
|
$Form
|
Loading…
Reference in New Issue
Block a user