Documentation for the custom error show function.

Thanks to Andjelko Horvat for providing the documentation patch.

git-svn-id: http://simplesamlphp.googlecode.com/svn/trunk@2725 44740490-163a-0410-bde0-09ae8108e29a
This commit is contained in:
olavmrk 2011-01-28 08:48:53 +00:00
parent 22e7cd83c9
commit c2ca538cc1
2 changed files with 22 additions and 0 deletions

View File

@ -38,6 +38,14 @@ $config = array (
'showerrors' => TRUE,
/**
* Custom error show function called from SimpleSAML_Error_Error::show.
* See docs/simplesamlphp-errorhandling.txt for function code example.
*
* Example:
* 'errors.show_function' => 'sspmod_exmaple_Error_Show::show',
*/
/**
* This option allows you to enable validation of XML data against its
* schemas. A warning will be written to the log if validation fails.

View File

@ -227,3 +227,17 @@ This happens regardless of whether the exception is delivered directly or throug
This is done to be consistent in what the application receives - now it will always receive the same exception, regardless of whether it is delivered directly or through a redirect.
Custom error show function
--------------------------
Optional custom error show function, called from SimpleSAML_Error_Error::show, is defined with 'errors.show_function' in config.php.
Example code for this function, which implements the same functionality as SimpleSAML_Error_Error::show, looks something like:
public static function show(SimpleSAML_Configuration $config, array $data) {
$t = new SimpleSAML_XHTML_Template($config, 'error.php', 'errors');
$t->data = array_merge($t->data, $data);
$t->show();
exit;
}