Home  >  Article  >  Backend Development  >  关于 模板化的MVC

关于 模板化的MVC

WBOY
WBOYOriginal
2016-06-06 20:37:31976browse

有时候为了更好的迎合 MVC的设计 模板引擎就出来了 ,有时候我觉得模板确实非常发方便。但是遇到比较复杂的判断的时候感觉就比较恼火了·· 比如 smarty 中 foreach 多个嵌套 然后 里面有 IF ELSE 各种变量 等等 在后面的修改工作中(比如在某个状态不应该显示某个数据)的时候,要去找 然后修改掉 真的很麻烦 感觉浪费了很多时间

回复内容:

有时候为了更好的迎合 MVC的设计 模板引擎就出来了 ,有时候我觉得模板确实非常发方便。但是遇到比较复杂的判断的时候感觉就比较恼火了·· 比如 smarty 中 foreach 多个嵌套 然后 里面有 IF ELSE 各种变量 等等 在后面的修改工作中(比如在某个状态不应该显示某个数据)的时候,要去找 然后修改掉 真的很麻烦 感觉浪费了很多时间

估计是因为你不熟悉,而且smarty的语法确实挺繁琐,很多的处理其实是可以在控制层实现的,view只做显示就可以了

知道MVVM和Restful嘛?

Statement:
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