Question
simple CFC question
So I can finally get around to learning proper usage of
cffunctions and CFCs, I'm working on a quick test app to get the
basics down. My question has to do with return types.
For example, I have a function called "updateUser". A form passes the usual info along with a userID into the function.
If the update is successful, I want to display a message "You have updated the user."
I'm getting hung up on the return types - specifically the use of a boolean return. Assuming if the update goes ok, the boolean return would be true. How can I test for this back on the update page?
If return type is true - display success message
else if it's false - display an error message
I guess I could put some additional cfreturns in the function and return a message string, but this just doesn't seem right?
For example, I have a function called "updateUser". A form passes the usual info along with a userID into the function.
If the update is successful, I want to display a message "You have updated the user."
I'm getting hung up on the return types - specifically the use of a boolean return. Assuming if the update goes ok, the boolean return would be true. How can I test for this back on the update page?
If return type is true - display success message
else if it's false - display an error message
I guess I could put some additional cfreturns in the function and return a message string, but this just doesn't seem right?