How should MVVM mode be applied in PHP?

Source: Internet
Author: User
How should the MVVM mode be applied in PHP? How is the MVVM mode applied in PHP? (1) whether the MVVM mode can be used in PHP; (2) whether the implementation method can be simply described. You don't need to provide specific code. what is MVVM? Model, View, and ViewModel. Model is the abstraction and encapsulation of data. For example, how should the MVVM mode be applied in PHP?
How is the MVVM mode applied in PHP?
(1) Can the MVVM mode be used in PHP;
(2) Can you briefly describe the implementation method.
You don't need to use specific code to give ideas.

------ Solution --------------------
What is MVVM? Model, View, and ViewModel.

Model is the abstraction and encapsulation of data. For example, Person.
View is the UI presentation layer that provides interaction with end users. For example, a user recruitment interface.
ViewModel is the core of this mode and provides a bridge between the Model and View. It should provide the processing corresponding to all possible operations of users in the View, and the logic can perform necessary operations on the Model, or cache the processing result, waiting for the next use


Therefore, Smarty is the best embodiment of ViewModel. Although Smarty is more than 10 years earlier than ViewModel
------ Solution --------------------
In php, we should say that pardo is close to this mode.
------ Solution --------------------
I think class + HTML + SMARTY combination is used. It's just like what you said. As for terms and definitions, I think both MVC and MVVM are a standard. the larger the standard, the better it will be for large companies. There are many users and they are easy to use. The specification is small. It may be limited to your company, so you don't need to go out of other people.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.