以下内容摘自 PHP for Absolute Beginners, Thomas Blom Hansen & Jason Lengstorf

The model-view-controller (MVC) design pattern is common approach to organizing scripts consistently. Using a consistent approach to organizing your scripts can help you develop and debug faster and more effectively.

At its most basic, MVC separates coding concerns into three categories: models, views and controllers. A model is a piece of code that represents data. You models should also hold most logic involved in the system you're building. A view is a piece of code that shows information visually. The information to be displayed by the view is received from a model. A controller is a piece of code that retrieves input from users and sends commands to relevant model(s). In short MVC separates user interactions from visual representation from system logic and data.

相关文章:

  • 2021-12-21
  • 2021-09-12
  • 2021-07-30
  • 2021-12-07
  • 2022-02-10
  • 2021-07-12
  • 2021-08-21
猜你喜欢
  • 2021-11-02
  • 2021-08-02
  • 2021-05-27
  • 2021-04-12
  • 2022-12-23
  • 2021-07-29
相关资源
相似解决方案