I have three class: A, B and C. In class A, A.php:
class A
{
function __Contruct()
{
//do something
}
}
In class B, B.php:
class B extends A
{
function __Contruct()
{
//do something
}
}
In class C:
class C
{
function __Contruct()
{
include(A.php);
$this->A = new A;
include(B.php);
$this->B = new B;
}
function _load()
{
//load class $X;
}
}
I need to load a class whose name is value of a variable:$X to class without word new in class B.
Can I do it this way:$this->classname->functionname();//classname is value of $X
in file B.php.