2: What Is The MVC Model | MVC Model Explained | Object Oriented PHP Tutorial For Beginners | mmtuts


In this PHP tutorial you will learn about the MVC Model, which is a design pattern we use in OOP PHP. I believe this video is important to watch in order for people to properly understand how OOP PHP works, so I don’t recommend skipping it.

Link to this playlist:


First of all, thank you for all the support you have given me!

I am really glad to have such an awesome community on my channel. It motivates me to continue creating and uploading content! So thank you!

I am now using Patreon to share improved and updated lesson material, and for a small fee you can access all the material. I have worked hard, and done my best to help you understand what I teach.

I hope you will find it helpful 🙂

Material for this lesson:

Nguồn: https://taiduc.org

Xem thêm bài viết khác: https://taiduc.org/cong-nghe/


  1. You have such a natural way of teaching and making everything look simple! I love your videos and the quality upgrade that this channel has had

  2. you are wrong here …. mvc is design pattern and independent of whether you want to use procedural or object oriented coding paradigm.
    damn your whole concepts are out of place, why the hell will you not display anything after login or registering users ? fuck.

  3. yeah, the view can get data from the model directly, or indirectly via the controller. Its very good that you have mentioned the 2 way of doing mvc.

  4. hey
    i wanted to know
    instead of creating classes if i created functions for connection, query and display and stored them separately.
    then called them when needed..
    will it qualify as MVC approach ?

  5. The procedural example is much more clear on what is going on. And there is no need to retype code, If a different page needs it you can Cut and Paste or just put it in a separate file and use includes. From this example I see complexity without much value. In the procedural version I see where the data is coming from and how it gets displayed in one simple page of code.

    I had a Ruby programmer tell me it was bad to know how the database worked, Seemed nutty to me. SQL is not rocket science.

  6. I am new to MVC and I now have a clearer understanding of MVC after watching your video. Thank you very much.

  7. Hi, first bit of code you've shown. looks like pdo ie using bind & placeholders etc. but whys it still using mysqli function.. not pdo

  8. theoretically it make sense to me. It just I don't have idea how can I breakdown the task. Do you have a video where you're applying mvc to a project?

  9. As a PHP Developer, i would argue that the original MVC pattern was misused. Before the year 2000 many Webdevelopment Agencies wanted to stand out, also the Framework Providers wanted to offer some Buzzword for selling. They used MVC for this case. MVC rely on events. If a Model was changed an even got triggered and notice the controller so that he can pass the new values to view. If you want to create original MVC in PHP you need a php process running whole time on your maschine and waiting for input or database triggers. But you cannot do this over HTTP since HTTP expect a response to shutdown the connection. Ofc many developers noticed the problem with a process and events and started to invent things like "Front Controller Pattern". Also as a Webdeveloper you also have contact with JavaScript on a different Layer. All of the sudden your View which display the output becomes a Model for a new MVC Layer. Because of this MVVM was then introduced.

    So the Web Languages reused the MVC wording for Marking Purpose while the pattern is not implementable in the language it self. To be precise you need actually to separate it into MVC and Web-MVC.

    Anyways a good Video, maybe you could create for your next videos, what is HMVC, MVP, MVVM and MVA 😀

    Ah and a little rant 😀 please don't use ?> at the end of the script (unless HTML code is displayed afterwards), this might cause "header cannot be sent" errors and it violate PSR-1

  10. The controller should feed the view, obviously…
    You'd only feed the view from the model for lazyness/prototyping

  11. The theory is explained very well in this video. Where I personally still fail is to find a good example where this theory is put into practice. I see there are a lot of videos from you which explain the basics of how to program in PHP but I haven't been successful finding great videos which show MVC running using a basic example. Is there something around from you?

  12. You are the best. it is my first comment in youtube. but actually i want to say thank you very much for all your great materials

  13. I have already made some classes for user login and stock management is it feasible two incorporate these into an MVc framework or would I need to start from scratch? Great video btw!

  14. Hi. I really like how deep you explain.
    I have a question if you can help me i would apreciate it.
    After login i create a session var with name from db. After update the name how can i update the session too? Thanks

  15. hello i have a question .. i am currently creating a website as a project using jsp … how can i make each item open in it's own specific page like how reddit works.. your help will be appreciated


Please enter your comment!
Please enter your name here