Flat Preloader Icon

What is MVC?

clock-o January 01,2021
QuestionsCategory: OpencartWhat is MVC?
admin Staff asked 3 years ago

1 Answers
admin Staff answered 3 years ago
This means Model, View Controller in Opencart. It is a way of seperating different types of code in an application.

The Model is for code relate to accessing the database whether that be for writing, reading or deleting. We have some logic there but really most of the business logic of what to do with that data once it is retrieved (or before saving it) is done in the Controller. Then you have the view which by the name I think you can guess its for the visual part of the software (in this case opencart). One more thing...you also have language files in Opencart so that usually needs to be edited or added to also which, you guessed it, stores the language for the feature your editing. Many other softwares and frameworks use this or something close to it.

The moral of that story is really to tell you that most of the time when you want to change something in Opencart or any other MVS based software you need to somehow modify those four file types to achieve your goal. That being said in Opencart you don't want to modify those files directly and instead use OCmod or an event.

menuchevron-down linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram