Skip to content

Commit 7ff4214

Browse files
committed
Documentation for the custom error show function.
Thanks to Andjelko Horvat for providing the documentation patch. git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@2725 44740490-163a-0410-bde0-09ae8108e29a
1 parent a884a0c commit 7ff4214

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

config-templates/config.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@
3838

3939
'showerrors' => TRUE,
4040

41+
/**
42+
* Custom error show function called from SimpleSAML_Error_Error::show.
43+
* See docs/simplesamlphp-errorhandling.txt for function code example.
44+
*
45+
* Example:
46+
* 'errors.show_function' => 'sspmod_exmaple_Error_Show::show',
47+
*/
48+
4149
/**
4250
* This option allows you to enable validation of XML data against its
4351
* schemas. A warning will be written to the log if validation fails.

docs/simplesamlphp-errorhandling.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,3 +227,17 @@ This happens regardless of whether the exception is delivered directly or throug
227227
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.
228228

229229

230+
Custom error show function
231+
--------------------------
232+
233+
Optional custom error show function, called from SimpleSAML_Error_Error::show, is defined with 'errors.show_function' in config.php.
234+
235+
Example code for this function, which implements the same functionality as SimpleSAML_Error_Error::show, looks something like:
236+
237+
public static function show(SimpleSAML_Configuration $config, array $data) {
238+
$t = new SimpleSAML_XHTML_Template($config, 'error.php', 'errors');
239+
$t->data = array_merge($t->data, $data);
240+
$t->show();
241+
exit;
242+
}
243+

0 commit comments

Comments
 (0)