What does mvc mean?
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, try, 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, and then classify it according to the following three parameters. 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
For more related knowledge, please pay attention to PHP Chinese website! !
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!