Learn CodeIgniter from Scratch by Building a Project (002 - Understanding MVC)
Hey guys, this is second part of the series, and in this part we will be taking a deep look at what is Model – View – Controller (MVC) and why we use it and how to take maximum advantage.
To overcome the problem developers came out with the idea of MVC (Model – View – Controller). The idea behind MVC is to split the app in three major areas:
And each area should be responsible for its own tasks and objectives.
Models held all the logic building and the database queries.
Controllers will be responsible for all the authentication and business logics and connects the models with views.
If a developer keep in mind the above sections properly, the application will be more manageable and less error prone, and believe me it will make life much easier when you want to make changes to a project in future.
Luckily, CodeIgniter is built using MVC and we will take full advantage of MVC throughout the series . So don't be afraid or get confused if the MVC picture is still foggy, I know, I been there, but just trust on me and finish the series with me, I promise you once we are done you are a master of MVC and CI3.
That is all for this tutorial, see you in the next part