What is the best approach for mvc? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

What is the best approach for mvc?

i created a clinic information system using php html js and jquery. i am kind of confused when ot comes to mcv because i usually code in blocks. any pointers for begginers like me when it comes to mvc?

12th Mar 2017, 5:41 PM
Allan Ceazar Oguis
Allan Ceazar Oguis - avatar
3 Answers
+ 11
Yeah, something that's already made and works is hard to modify. Try using it for future projects. Model - the methods and data that run the program's logic. Ex: Storing information and allowing it to be accessed by the Controller. The model should NEVER access the View - it should only return data for the Controller to use. View - What the user interacts with. This would be any forms they fill out and the site they navigate. Controller - Methods that link the two together. The controller reads what's happening in the View (Ex: Button clicked) and accesses the Model for what the user wants (Ex: Send in their form, display info on x user).
12th Mar 2017, 6:05 PM
Tamra
Tamra - avatar
+ 2
MVC it is Architecture decision,it approach you should implement from the beginning of development,if you created some product and then remembered about MVC - my advice - Leave as is
12th Mar 2017, 5:51 PM
Ihor