• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.