Open inghamn opened 9 years ago
what are the possible errors? What was the field? Defer the message text to the view Validation should throw a single exception
$errors = [ 'fieldname' => [ 'errorType1', 'errorType2', 'errorType3 ], 'otherField' => [ 'otherFielderror', 'otherFieldProblem' ] ];
Model should define the validation fields and possible errors. Model should implement the validation check
Controller tries to save, catches the exception, Passes the exception to the SESSION, and lets the form render
Model save triggers validation
$_SESSION['messages']['validation'] = $errors;
what are the possible errors? What was the field? Defer the message text to the view Validation should throw a single exception
Model should define the validation fields and possible errors. Model should implement the validation check
Controller tries to save, catches the exception, Passes the exception to the SESSION, and lets the form render
Model save triggers validation
$_SESSION['messages']['validation'] = $errors;