02-27-2008, 10:56 PM
|
#4 (permalink)
|
|
The Contributor
Join Date: Feb 2008
Location: Croatia
Posts: 90
Thanks: 4
|
Yes.
Let's say you have a multilingual site.
PHP Code:
<?php
function test( $t ) {
global $lang;
if ( !is_numeric( $t) ) {
throw new Exception ($lang->NUMERIC_ERROR);
} else {
echo $t;
}
}
try {
test( 'a');
}
catch( Exception $e ) {
// Some error managment
$tmpl->addVar( 'error', $e->getMessage() );
$tmpl->activate( 'errorLayout' );
}
?>
For example.
__________________
Back from sysadmins to the programmers.
|
|
|