作者:mobiledu2502887403 | 来源:互联网 | 2023-12-10 20:58
Todayatworksomeonetriedtoconvincemethat:今天在工作中有人试图说服我:{$obj->getTableInfo()}isfine
Today at work someone tried to convince me that:
今天在工作中有人试图说服我:
{$obj->getTableInfo()}
is fine for smarty/mvc/templating because it is using an objects method. I argued that because it makes a call to the database it has no place being there and it should be in the controller (we don't actually use MVC). Am I right in my understanding of the logical separations that are used in MVC and generally in templating? Or is there something that I am missing?
适用于smarty / mvc / templating,因为它使用的是对象方法。我认为,因为它调用数据库它没有位置,它应该在控制器中(我们实际上不使用MVC)。我是否正确理解MVC中使用的逻辑分离以及模板化中的逻辑分离?或者有什么我想念的东西?
3 个解决方案