If you just finished beginner level PHP and OOP then you need to focus on MVC workflow. Because 99% framework like Laravel, CodeIgniter, Zend, Yii, CakePHP, etc are created with MVC technology. Besides PHP language, MVC is supported by other languages like Java, C# (C-Sharp), etc. So it has an extreme-level facility to make a big project 🙂
What is MVC
We can see the MVC definition from Wikipedia. MVC full form is Model, View, Controller. When you will learn OOP (Object Oriented Programming) in PHP, you will learn about many design patterns like- Abstract, Singleton, Factory, Observer, Decorator, Facade, etc.
So MVC is a software design pattern commonly used for developing user interfaces that divide the related program logic into three (Mode-View-Controller) interconnected elements.
How does work MVC
Generally a Controller process request from GET, POST method. A Model communicates with the Controller via SELECT, INSERT, UPDATE, DELETE and View display processed data with HTML. Details are bellow-
- ✓ Data related logic
- ✓ Interacts with the database (SELECT, INSERT, UPDATE, DELETE)
- ✓ Communicates With Controller
- ✓ Can sometimes update the view
- ✓ What the user sees in the browser (UI)
- ✓ Usually consists of HTML/CSS
- ✓ Communicates with the controller
- ✓ Can be passed dynamic values from the controller
- ✓ Receives input from the URL, form, view, etc
- ✓ Processes requests (GET, POST, etc)
- ✓ Gets data from the model
- ✓ Passes data to the view
Actually, I have inspired to read the post from Brad Traversy Media. They have many free and premium tutorials on PHP. Note that: they aren’t paying me to write the post, I love their tutorials, so I have shared 😛
BTW, now I think you know how does work the MVC technology. Now if you complete a free course on MVC from YouTube, the concept will more clear. Later you will learn CodeIgniter. Because it’s an easy framework created with MVC style.
Don’t forget to share the article with your friends.