Afficher un message
Vieux 12/09/2007, 20h47   #2
ragearc@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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;
}
}

  Réponse avec citation
 
Page generated in 0,04734 seconds with 9 queries