show_404()

show_404($page = '', $log_error = TRUE)

Parameters:
  • $page (string) – URI string
  • $log_error (bool) – Whether to log the error
Return type:

void

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

application/views/errors/html/error_404.php

or:

application/views/errors/cli/error_404.php

The function expects the string passed to it to be the file path to the page that isn’t found. The exit status code will be set to EXIT_UNKNOWN_FILE. Note that CodeIgniter automatically shows 404 messages if controllers are not found.

CodeIgniter automatically logs any show_404() calls. Setting the optional second parameter to FALSE will skip logging.

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

Please login to continue.