File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515
1616class Form extends BaseForm
1717{
18+ /**
19+ * Session key for the success state.
20+ *
21+ * @var string
22+ */
23+ const FLASH_KEY_SUCCESS = 'form.success ' ;
24+
1825 /**
1926 * Indicates whether the validation should still be done
2027 *
@@ -76,7 +83,7 @@ function __construct($rules = [], $sessionKey = null)
7683 $ this ->shouldRedirect = true ;
7784 $ this ->shouldFlash = true ;
7885 $ this ->shouldFallThrough = false ;
79- $ this ->success = false ;
86+ $ this ->success = $ this -> flash -> get ( self :: FLASH_KEY_SUCCESS , false ) ;
8087 }
8188
8289 /**
@@ -207,6 +214,8 @@ public function action($action, $options = [])
207214 */
208215 public function done ()
209216 {
217+ $ this ->flash ->set (self ::FLASH_KEY_SUCCESS , $ this ->success );
218+
210219 if ($ this ->shouldRedirect ) {
211220 die (Response::redirect (Url::last ()));
212221 } else {
You can’t perform that action at this time.
0 commit comments