In the MVC development framework, when checking the validity of the content entered by the user when submitting, is it completed by c or m?
phpcn_u1582
phpcn_u1582 2017-05-16 17:06:31
0
13
1102

Currently when you use the mvc development framework, when checking the legality of user input text on the user front end, when the user submits, should this be handled by the c layer or the m layer?

phpcn_u1582
phpcn_u1582

reply all(13)
左手右手慢动作

Model layer. First of all, the Controller does not do any verification. The View layer can also do verification, but it is usually placed on the model layer

某草草

M layer and C layer are not verified. Generally, there will be a Service on the M layer, and processing is usually done in the Service.
Why not do the verification in the Controller? Because we need to take into account the webservice. The same business has two Controllers for the page and the webservice, so the code written in the Controller cannot be reused

给我你的怀抱

M layer
You have to remember: MVC
The M layer handles everything related to data.
The V layer handles everything related to data presentation.
The C layer just wants a data pipeline to link these contents.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template