php - Database calls in Smarty/views/templates -


Today someone tried to tell me that:

  {$ obj - & gt; GetTableInfo ()}  

for Smarty / mvc / templating is okay because it is using an object method I argued that because it calls the database, there is no space in it and it should be in the controller (we do not actually use MVC). Am I right in my understanding of logical differences that are used in MVC and usually in templateting? Or is there something that I'm missing?

You are right, it is wrong.

If you want to correct MVC, then the database call, no matter what the form, should remain in the controller.

Obviously, what people have all this is should become such stuff and do it, but this is not the right way.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -