No look at the architecture would be complete without mentioning the model-view-controller (MVC) design pattern. If you have written PHP before, or looked at any of the other numerous frameworks out there, you would have heard of the MVC pattern. It allows the logical separation of code. The controller handles the logic while the model ensures the consistency of data and also performs the interaction with the data store. The view presents the results of the controller and model to the user. So far, so good; why mention the MVC pattern? Well, FuelPHP introduces the ViewModel and some base classes to give you a head start on your project.
Views are stored in the views
folder within the app
folder, for example, fuel/app/views
.
They can be grouped together in subfolders and normally relate directly to a controller action, for example, login.php
, which is located in fuel/app/views/user/
, would relate to the login
method within the user
controller...