|
Posted by PaowZ on 09/12/07 17:03
Hello there!
I'd like to make some declared vars available to classes, such as:
<? //main environment
$myVar = new MyClass(); //the var I want to be available to OtherClass
....
....
class OtherClass{
private $otherVar = $myVar; //seems to not work
...
}
?>
...and I wish to initialize $otherVar 'as is', I mean, without having
to pass arg through __construct(). The way I tried above doesnt seem
to work, unlike it would be in a function..
any idea ??
thanks a lot :)
Navigation:
[Reply to this message]
|