diff --git a/components/README b/components/README index ddb7f06da724a184051073d98257822ed41a1608..bcae188520735d94949c0fb0744d764913c5d82d 100644 --- a/components/README +++ b/components/README @@ -35,3 +35,11 @@ $session->data array for storing persistant data any values stored in data[] will be persistant between pages for as long as the users session cookie stays active. + +For error handling, your component should use the trigger_error() function: + +trigger_error("Informational message", E_USER_INFO); // To inform the user that something happened, e.g. the session expired +trigger_error("Warning message", E_USER_WARNING); // Warn the user of an expected error, e.g. incorrect password +trigger_error("Error message", E_USER_ERROR); // Reserved for unexpected conditions, e.g. unable to connect to database + +You may also use the message_flash("status message") function for helpful messages, e.g. form submitted