I'm wondering how I can call the index function inside the class
public function index()
// do stuff..
You can call index on an instance of
$app = new App(); $app->index();
However, it feels like there is something missing here. Typically you would have a router that would handle instantiating the correct controller based on the route requested by the user.
You can use the above code to manually instantiate the app controller and call index, but again, I think there is a missing piece.