Reply to How to access any function of a any class?

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация