here is my problem:
I have a class that contains an instance of another class (nested not extended!!!)
Something like:
class a{
var $name;
function setName($strName){
$this->name = $strName;
}
class b{
var $obja;
var $b;
function b(){ /* constructor */
$obja = new a;
}
function setNameA(str){
$this->obja->setName(str); /* this line give me an error: */
} /* Call to a member function on a non-object */
I tried also:
function setNameA(str){
$tmp = $this->obja;
$tmp->setName(str);
}
that produces the same error (this is like your example (I think))
also tried
function setNameA(str){
global $obja;
$obja->setName;
}
getting the same error...
Any ideas???
Answer if you can.
Thanks for your time