You can hand over the pointer to the instantiated class to the method of another class.
Example:
(May be wrong, haven't bothered with php and classes for some time now)
// Class Definitions
class class_a {
function method_a($var_a){
[...]
}
}
class class_b {
function method_b($class_pointer_a, $var_c){
$blahblah = $class_pointer_a->method_a($var_c);
[...]
return;
}
}
// Instantiating classes
$class_pointer_a = new class_a();
$class_pointer_b = new class_b();
// Usage
$class_pointer_b->method_b($class_pointer_a, $var_c);
__________________
karrde, Retired head of "Myrkrs roid liberation and smuggling Inc."
One OS to rule them all, One Passport to find them,
One OS to bring them all, And with the EULA bind them.
In the land of Redmond where the windows lie.
"...to leave the Elysium the dead had to drink from and travel beyond the River of Oblivion, Lethe, to once again return to the mortal realm..."
|