php mvc is a design model; M in mvc represents model model, which is used to complete specific business logic; V represents view, which is responsible for displaying information; C represents controller, which is responsible for issuing orders.
#The operating environment of this article: Windows 7 system, PHP version 7.1, Dell G3 computer.
What does php mvc mean?
Basic understanding and principles of MVC in php
php mvc meaning
What is MVC?
For novices, this part may not be very understandable. MVC is a design model that allows us to separate business logic and specific data display and layer them.
M:model model, complete the specific business logic
V:view, view, responsible for displaying information
C:controller, the controller is responsible for issuing orders, playing the role of a The role of a traffic policeman (distinguish between methods, and determine which method to use when a demand is received from the front desk)
The basic principles and details are summarized in a picture:
Explain: We enter the url through the browser. When the request is processed by the server, it will first parse the url, then classify it according to the next three parameters, and find the corresponding platform according to the p parameter. c finds the corresponding controller, and finds the method in the corresponding controller according to a. The corresponding controller then calls the database model to perform corresponding database operations and logical processing of data according to the specific conditions, and returns the results, which are then processed by the view layer. show.
The complexity and diversity of functions of a website determines the need for multiple controllers to handle various modules, so we can first define a controller base class, save the public methods, and increase code reuse
The advantages of mvc are obvious: the layering is very clear, which facilitates team development and modification
Recommended learning: "PHP Video Tutorial"
The above is the detailed content of What does php mvc mean?. For more information, please follow other related articles on the PHP Chinese website!