webCOMAND

view::show_error()

Produce an error response and exit, which is useful when a controller can find the requested resource, but some other error occurred.

This method will send the error response and terminate PHP execution, so it never returns.

Prototype

void show_error(string $message = '', string $filename = NULL, string $status_code = 500)

Parameters

  • message - Message to display on 500 (or other Status Code) page.  Can contain HTML.
  • filename - Path to a cMVC view that will receive the message as $message.
  • status_code - The HTTP response status codes to return with the error page.

Example

\io_comand_mvc\view::show_error('OID does not reference a Contact');

Related

show_404()