1. Home
  2. Docs
  3. Simpods MVC
  4. Tutorials
  5. MVC Structure

MVC Structure

The Model-View-Controller pattern is a way of structuring an application with clear separation of concerns between its data, display and logic.

Model

The model is responsible for storing and manipulating state. In Simpods these will mostly consist of database queries with some structuring of related data, calls to external APIs could also be done here.

View

The view is responsible for presenting data to the user along with forms or other inputs if appropriate. In Simpods these take the form of standard WordPress templates along with any associated CSS and Javascript.

Controller

The controller provides the link between the model and the view. It is responsible for deciding what data should be passed between the model and view, including the processing of user input. In Simpods these are also responsible for loading the Javascript and CSS files needed by the view.

Articles