So I'm writing my MVC and need to display my views.
It's pretty simple at the moment, just wrapped in a function inside my main controller.
ob_start();
require_once('views/' . $fileName . '.php');
$output = ob_get_contents();
ob_end_flush();
return $output;
However, I don't quite understand how to set all the variables within the view I am rendering, and this is the most important part (no shit).
Any tips in regards to doing this? And any code samples you want to share in regards to a basic MVC framework?
I'm writing the most basic thing I could think of, with just a few controllers, models, views, an autoloader, and a index.php to route all the requests. I'm not interested in rewriting using IIS rewrite module, so I'm just running _GET to fetch the query string.
Thanks in advance, you people are always a great help.