Question About Mvc

Dear All,

Hope everyone is fine. I have a question about MVC Framework like Yii or something like that. My question is

Where should be put SQL query Model OR Controller and why ? what is advantages ? like some example…

Your opinion is very important.





Please take a look at this section of the guide. :)

Hi my friend

In addition notify that even the sql must definitely reside in model,

you can pass parameters from controller to method of the model for more flexibility

There are special cases (rarely) that you could use it directly in controller

see an example

but only if you do not use the same sql pattern more than one time in your application