Re: accessing vars from within classes



Yep, I believe global would work.

PHP:

$myVar = new MyClass();

class OtherClass {

private $otherVar;

function myMethod() {
global $myVar;
$this->otherVar = $myVar;
}
}

.



Relevant Pages