From a1d327d4657f8fa9d258ab2a2137134497181c09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20Beno=C3=AEt?= Date: Mon, 6 Feb 2012 17:26:55 +0100 Subject: [PATCH] Form controllers improvement Form controllers are now able to return something other than true or null. Whatever is returned by the form controller will be passed on by the form if it isn't a boolean. --- includes/form/ctrl.inc.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/form/ctrl.inc.php b/includes/form/ctrl.inc.php index d838213..067df7b 100644 --- a/includes/form/ctrl.inc.php +++ b/includes/form/ctrl.inc.php @@ -64,8 +64,10 @@ class Ctrl_Form if ( $cResult === null ) { return $this->form->view( ); } - if ( $cResult ) { + if ( $cResult === true ) { $url = $this->form->successURL( ); + } elseif ( $cResult ) { + return $cResult; } else { $url = $this->form->cancelURL( ); }