Hey,
I have two separate objects, a main and a "child". Its physically not a real child object, because I add the whole parent through the constructor to the child.
Bu gibi:
class core
{
public function __get($class)
{
$this->load($class);
}
public function load($class, $file = null, $lib = true)
{
if($file == null)
$file = $class;
if($lib == true)
include(LIBPATH.$file.PHP);
else
include(SYSPATH.$file.PHP);
$this->$class = new $class($this);
}
}
Ve "çocuk":
class Child implements myStruct
{
public function __construct($obj)
{
$this->obj =& $obj;
}
}
Bence bu kadar çirkin mi, yoksa bu çözüm kabul edilebilir mi?