MVC is a design standard.
Design standards should be employed to solve a common and standardized "problem", allowing proven solutions and/or standardize architectures allowing a team to work homogeneously.
In this way, the MVC design standard was created to solve the logical organization problem of a project, using separation by responsibilities, thus the (M)model is responsible for manipulating data and/or the logical part of the application, the (V)is not responsible for applying all the information output logic - it can be a "screen" in HTML or the generation of XML or JSON responses; finally the (C)controller is responsible for orchestrating models and views by functionality, being the one who receives the action requests, identifies which models should process the data for a request and which views should return the request output/response.
It is also possible to apply other design standards together to solve various "problems" - Front Controller to centralize the request processing, allied to Dispatcher for identification and instantiation of the correct controller to handle a request; DAO/ORM/Active Records to handle persistent data manipulation; Layer Services for agnostic separation from application logic, etc.
Note therefore that there is a need to apply the concepts correctly.
Regarding your questions listed
the Model should handle data, this is the definition, do not think correct in the model, for example, make the connection with the bank, the ideal is to use dependency injection for this purpose with a class specialized in dealing with the low-level issues of the bank.
Creating a Template by table probably implies applying the Active Record project pattern. This does not prevent you from, for example, having models that handle session data, such as a shopping cart model, or models that manipulate collections in arrays. The ideal is that a model has no logic of processing requests or vision.
I’m going to repeat virtually the entire @Maniero response:
The button generates an action/request for the controller. This controller will handle the request, can validate input data, but not handle this data, then passes it to the model (query, change data etc). After the model(s) (s) manipulates the data, the controller sends the model(s) to a view and the view(s) generates the output (a screen, a report, an XML, etc.). This is the standard MVC flow. It just won’t generate a view when you don’t have to present anything. Only it will not consult the model if it does not need any data that is there (remembering that the model may have information beyond the database). Then it is assembled by the whole of the three things, each doing its part.
In general these files must be in a public access folder for the client (browser) or subfolders of this folder. But exactly how you organize is at the discretion of a good adequacy study and (like) your or your team.
My suggestion would be that you, in addition to studying the concepts of design standards, study and use a framework consolidated, which already implements good software architecture using these standards. My preference list would be: Laravel, Symphony, Zend Framework; I don’t know but are frameworks consolidated with good community: Phalcon, Yii.
So technically I can do it the way I think best?
– Fleuquer Lima
If you know what you’re doing :) The important thing is that each action should serve a purpose that helps your application to be better. You may even wonder if using MVC is best for your application.
– Maniero
My application is a role-playing game, do you think the MVC model would help me reuse codes? Sometimes I feel that the model "locks" me a little for this type of application, but I also feel safer using it, since I need many constant checks.
– Fleuquer Lima
It is hard to say without knowing all the details. MVC is not to reuse codes, on the contrary, the application tends to get more repetitive.
– Maniero
+1, and has already started perfect "There is no such thing as good practice. There is right or wrong for every situation." I sign under this phrase, and I think it should be the first "class" in the academic environment (where unfortunately, in a significant part of the institutions, it is usually preached the contrary).
– Bacco