Hi is it possible to call multiple $this
in a single __construct()
? I'm
relatively new to PHP OOP and MVC. Because I want to call a function in a
function so I thought of using the code below. Or is there any other way to
do better than this?
//maincontroller.php
class MainController{
public $controller2;
public $controller3;
function __construct(){
$this->controller2 = new Controller2();
$this->controller3 = new Controller3();
}
}
//controller2.php
class Controller2{
}
//controller3.php
class Controller3{
}