error_reporting(E_ALL);
class Test
{
public function index()
{
echo 'index';
}
}
class Loader
{
public function __construct()
{
$this->test = new Test;
}
}
class Controller
{
public function __construct()
{
$this->load = new Loader;
}
}
class Sample extends Controller
{
public function __construct()
{
parent::__construct();
$this->load->test->index();
}
}
new Sample;
Как мне из класса Sample вызвать метод класса Test без load в $this->load->test->index(), то есть $this->test->index()?