I recently picked up learning PHP and MySQL and I am trying to build a small usersystem as a coding exercise. While learning to use classes and functions, I also stumbled upon the MVC model and would like to implement the model in my code.
Is the following approach correct MVC?
index.php, message.php, user.php are all a bunch of controllers. They start a model, collect $_GET, $_POST and $_SESSION user data and passes that on to the model. They may collect info from the model and pass it on to the views.
the user class, message class, etc. ... are all parts of the model. They validate the data that the controller gives them, do the actual database stuff and return data to the controller and the view.
the views are puzzled together by the controller. They mainly echo data from the model & the controller and include html files.
My main concern is how the view displays data from the model. Is it better to go through the controller or should I directly get it from the method whenever I can?