Posted by pf on 03/16/05 15:27
Hello.
Please consider this:
class A {
function A(&$Cont){
$this->Container= &$Cont;
}
function A_1(){
$this->Container->objB->B_1("somehing");
}
}
class B {
function B(&$Cont){
$this->Container= &$Cont;
}
function B_1(){
//anything
}
}
class Container{
function Container(){
$this->objA=new &A($this);
$this->objB=new &B($this);
}
}
$MyOBJ=new Container();
The problem is that "sometimes" member functions and variables can be
reached this way, but sometimes not (mainly variables or file pointers)
depending WHEN you create the object and when (for example) you create a
file pointer inside some class.
What I want to do is to be able to use any function of any class from any
function of any class.
Any ideas are welcome.
Thanks a lot in advance!
[Back to original message]
|