Welcome Guest, Not a member yet? Register   Sign In
What's the best way to validate data in both controllers and models, before creating/reading/updating/deleting this data
#2

[eluser]@robertotra[/eluser]
[quote author="skcin7" date="1329815327"] ...I can't seem to figure out a way that controllers and models would both be able to work with each other to write to the $errors[] array, and have the errors (if any) sent to the view to properly be displayed...[/quote]

Maybe with a multidimensional session array:
Code:
session_start();

$_SESSION['errors']['controller'][] = 'error caught in the controller';

$_SESSION['errors']['model'][] = 'error caught in the model';

R.


Messages In This Thread
What's the best way to validate data in both controllers and models, before creating/reading/updating/deleting this data - by El Forum - 02-21-2012, 02:55 AM



Theme © iAndrew 2016 - Forum software by © MyBB