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.
This commit is contained in:
parent
c73baa8488
commit
a1d327d465
1 changed files with 3 additions and 1 deletions
|
@ -64,8 +64,10 @@ class Ctrl_Form
|
||||||
if ( $cResult === null ) {
|
if ( $cResult === null ) {
|
||||||
return $this->form->view( );
|
return $this->form->view( );
|
||||||
}
|
}
|
||||||
if ( $cResult ) {
|
if ( $cResult === true ) {
|
||||||
$url = $this->form->successURL( );
|
$url = $this->form->successURL( );
|
||||||
|
} elseif ( $cResult ) {
|
||||||
|
return $cResult;
|
||||||
} else {
|
} else {
|
||||||
$url = $this->form->cancelURL( );
|
$url = $this->form->cancelURL( );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue