Home > Backend Development > PHP Problem > What does php mvc mean?

What does php mvc mean?

青灯夜游
Release: 2023-02-28 20:16:01
Original
3432 people have browsed it

What does php mvc mean?

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:

1 (1).png

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template