Skip to content

Instantly share code, notes, and snippets.

@radmiraal
Created March 9, 2012 15:44
Show Gist options
  • Save radmiraal/2007158 to your computer and use it in GitHub Desktop.
Save radmiraal/2007158 to your computer and use it in GitHub Desktop.
Exception
<?php
namespace TYPO3\FLOW3\Utility\Exception;
/* *
* This script belongs to the FLOW3 framework. *
* *
* It is free software; you can redistribute it and/or modify it under *
* the terms of the GNU Lesser General Public License, either version 3 *
* of the License, or (at your option) any later version. *
* *
* The TYPO3 project - inspiring people to share! *
* */
/**
* Error message renderer
*
*/
class MessageRenderer {
/**
* Return an error message in HTML format
*
* @param string $errorCode The actual error code, like 500 Internal Server Error
* @param string $errorDescription A short, neutral, description
* @param string $referenceCode A more detailed reference about the error
* @return string The renderered HTML code
*/
static public function render($errorCode, $errorDescription, $referenceCode = '') {
$html = file_get_contents(FLOW3_PATH_FLOW3 . 'Resources/Private/Error/Template.html');
return str_replace(
array(
'{errorCode}',
'{errorDescription}',
'{referenceCode}'
),
array(
$errorCode,
$errorDescription,
$referenceCode
),
$html
);
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment