validation_errors()

validation_errors([$prefix = ''[, $suffix = '']])

Parameters:
  • $prefix (string) – Error opening tag
  • $suffix (string) – Error closing tag
Returns:

HTML-formatted form validation error message(s)

Return type:

string

Similarly to the form_error() function, returns all validation error messages produced by the Form Validation Library, with optional opening and closing tags around each of the messages.

Example:

1
2
3
4
5
6
7
8
9
echo validation_errors('<span class="error">', '</span>');
 
/*
        Would produce, e.g.:
 
        <span class="error">The "email" field doesn't contain a valid e-mail address!</span>
        <span class="error">The "password" field doesn't match the "repeat_password" field!</span>
 
 */
doc_CodeIgniter
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.