Home  >  Article  >  Backend Development  >  数据格式的处理你们放在m层还是c层?

数据格式的处理你们放在m层还是c层?

WBOY
WBOYOriginal
2016-06-06 20:25:191513browse

一般大家从数据库拿到数据,要在前台显示,做些格式,内容上的微调和处理的方法
这个方法你们是放在model层还是logic层还是用event来做?
还是直接写在controller层里?

回复内容:

一般大家从数据库拿到数据,要在前台显示,做些格式,内容上的微调和处理的方法
这个方法你们是放在model层还是logic层还是用event来做?
还是直接写在controller层里?

写在Controller层,更确切的说应该是写在View层,Model里不错数据的转换,不然ORM就成空谈了。

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