🔴 Advanced  ·  Lesson 39

MVC Architecture

MVC Architecture

What is MVC?

MVC (Model-View-Controller) is a way to organize code into three parts, keeping logic, data and display separate. Used by Laravel, CodeIgniter and most frameworks.

The Three Parts

PartJob
Modeldata + database logic
ViewHTML the user sees
Controllerhandles requests, connects Model and View

How a Request Flows

User request → Controller → asks Model for data → passes it to View → View shows HTML to user.

Summary

  • MVC splits code into Model (data), View (display), Controller (logic).
  • Keeps projects organized and is the base of modern PHP frameworks.

MVC क्या है?

MVC (Model-View-Controller) code को तीन हिस्सों में organize करने का तरीका है, logic, data और display अलग रखता है। Laravel, CodeIgniter और ज़्यादातर frameworks use करते हैं।

तीन हिस्से

Partकाम
Modeldata + database logic
Viewuser को दिखने वाला HTML
Controllerrequests संभालता है, Model और View जोड़ता है

Request कैसे बहता है

User request → ControllerModel से data माँगता है → View को देता है → View user को HTML दिखाता है।

सारांश

  • MVC code को Model (data), View (display), Controller (logic) में बाँटता है।
  • Projects organized रखता है और modern PHP frameworks का आधार है।
← Back to PHP Tutorial
🔗

Share this topic with a friend

यह topic किसी दोस्त को भेजें

Found it useful? Send it to a classmate learning the same thing.

अच्छा लगा? जो दोस्त यही सीख रहा है, उसे भेज दीजिए।