I'm currently designing my own MVC framework in PHP. I've read a lot about MVC frameworks and made one where the controller handles the models and renders the views, although this is not recommended.
The structure works as follows: The bootstrap class loads the proper controller, methods and variables based on the URL. It also initiates a maincontroller, mainmodel and mainview, which have some general functions. The controllers initiate their model and in the end render their template.
The problem is that I have 3 MVC objects. A top menu, a search bar and a table. I want these to be rendered on the same page. But since I let the controller do the rendering I can't render the three different parts in the same webpage. Do I need some kind of helper class, and if so how do I implement it the right way?
The url would be like: localhost/MyApp/grid.
Every controller contains this code:
$this->view->render(filepath/file.php)
Every template contains the code:
echo $this->data