mercredi 28 juin 2017

What do Model and Controller exactly do

I have a object: User {id; name; value; password;}. I want to construct a MVC model for user management. But I don't know exactly what function i need to implement between model and controller layer. Make it easy to understand, i have some situation: 1. I implement change_password function. Should I implement in model or do it in controller and call update function in model? 2. I want to get total value of all users. Should I implement SUM query in model a directly or get all user (call get_all function) from model then i calculate total by "for array" in controller?

Aucun commentaire:

Enregistrer un commentaire