I’m working on a big Snippet / Module that requires localized error messages. So I created an include file with an array of error messages... but I am having trouble calling the errors from within the class that I’m using. I think it’s probably just a simple scope type of problem, but I’m missing it.
My Snippet looks something like this:
<?php
include_once('lang/english.inc.php');
// ... stuff ...
if ( !file_exists( $filename ) ) {
exit($_lang['file_not_found']);
}
// ... more stuff...
$crud_obj = new Thingy();
?>
The error messages in the Snippet work... but then when I’m in my Thingy class, they don’t show. Do I need to pass the $_lang array into the class or something?
Any ideas? Thanks.