阅读背景:

直接从Model(MVC)获取HTML是一个好主意吗?

来源:互联网 

Looking at examples and tutorials for some MVC libraries for web development on the Internet, I found that many of them construct HTML directly in the code of Model class and then Controller just sends it to the View which just displays it. While this makes Controller and View very simple and clean, I feel it is a wrong approach. IMHO, Model should just retrieve data, without having any representation logic in it. Controller should pass this data to the View, and View would contain the code that iterates through it and generates final HTML.Looking at examples and tutorials for some MVC




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: