How should the MVVM pattern be applied in PHP?
How is the MVVM pattern applied in PHP?
(1) Whether the MVVM mode can be used in PHP;
(2) Can not simply say the implementation method.
Just give me the idea. No specific code
------Solution--------------------
What is MVVM, that is Model,view,viewmodel.
Model is the abstraction of data, the encapsulation of data. For example, person.
View is the UI presentation layer that provides interaction with the end user. For example, a user recruitment interface.
ViewModel is the core of this model, providing a bridge between model and view. It should provide a handle to the possible actions of all users in the view, and the process can go to the model to do the necessary operations, or cache the processing results, waiting for the next use
Thus Smarty is the best embodiment of ViewModel. Although Smarty is older than ViewModel for more than ten years
------Solution--------------------
PHP should say Pardo approach this pattern.
------Solution--------------------
I think it's a combination of class +html+smarty. No, just like the landlord you said this. As for the definition of nouns, I think MVC, or MVVM, is a norm, and the bigger the norm, the better it is for big companies. Use more people, get started fast. The specification is small. Maybe it's confined to your company.
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