What framework mode does php have?

王林
Release: 2023-02-26 10:12:01
Original
3155 people have browsed it

What framework mode does php have?

MVC

#mvc design pattern core:

Decoupling, allowing different code blocks to reduce coupling and enhance Code extensibility and portability, achieving backward compatibility.

The functions of each part of mvc:

M is spelled out as Model, which mainly encapsulates access to the database layer and adds, deletes, modifies, and queries the data in the database.

V is spelled out as View, which is used to encapsulate results and generate html content for page display.

C is spelled out as Controller, which is used to receive requests, process business logic, interact with Model and View, and return results.

MVT

The functions of each part of MVT:

M is spelled out as Model, which has the same function as M in MVC and is responsible for interacting with the database. Perform data processing.

V is spelled out as View, which has the same function as C in MVC. It receives requests, performs business processing, and returns responses.

T is spelled out as Template, which has the same function as V in MVC and is responsible for encapsulating and constructing the HTML to be returned.

MVVM

MVVM is an architectural pattern, not a framework. It is an idea and an art of organizing and managing code. It utilizes data binding, attribute dependencies, routed events, commands and other features to achieve an efficient and flexible architecture.

The core of MVVM is data-driven, namely ViewModel. ViewModel is the relationship mapping between View and Model. ViewModel is similar to a transfer station (Value Converter), responsible for converting data objects in the Model, making the data easier to manage and use. The essence of MVVM is to operate the view and then the DOM based on the operation data. With the help of MVVM, there is no need to directly operate the DOM. Developers only need to complete the view template containing declaration binding and write the business in the ViewModel, so that the View can be fully automated.

Recommended tutorial: PHP video tutorial

The above is the detailed content of What framework mode does php have?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
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