show_error()

show_error($message, $status_code, $heading = 'An Error Was Encountered')

Parameters:
  • $message (mixed) – Error message
  • $status_code (int) – HTTP Response status code
  • $heading (string) – Error page heading
Return type:

void

This function will display the error message supplied to it using the error template appropriate to your execution:

application/views/errors/html/error_general.php

or:

application/views/errors/cli/error_general.php

The optional parameter $status_code determines what HTTP status code should be sent with the error. If $status_code is less than 100, the HTTP status code will be set to 500, and the exit status code will be set to $status_code + EXIT__AUTO_MIN. If that value is larger than EXIT__AUTO_MAX, or if $status_code is 100 or higher, the exit status code will be set to EXIT_ERROR. You can check in application/config/constants.php for more detail.

doc_CodeIgniter
2016-10-15 16:32:40
Comments
Leave a Comment

Please login to continue.