Hi, I know this is probably very simple, but I just don't get it running.
I want to include a file within a class, so that it is globally visible within the whole class.
Within the functions of a class this works:
require ("language/" . $this->language . ".php");
Yet it doesn't outside of the functions. That's how I imagine it:
class Page {
var $language = 'en';
require ("language/$this->language.php");
function someFunction() {...}
}
Here I get the error:
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR'...
How can I include a file for the whole class, so that it is globally visible? Thanks for your help!
c.
I want to include a file within a class, so that it is globally visible within the whole class.
Within the functions of a class this works:
require ("language/" . $this->language . ".php");
Yet it doesn't outside of the functions. That's how I imagine it:
class Page {
var $language = 'en';
require ("language/$this->language.php");
function someFunction() {...}
}
Here I get the error:
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR'...
How can I include a file for the whole class, so that it is globally visible? Thanks for your help!
c.