doumaji6215 2015-06-15 10:12
浏览 67
已采纳

mvc模式中php控制器的起源是什么?

What is the origin of the controller in a OOP PHP application?

Why if I put an url like:

www.mysite.com/index.php/controller=mycontrol&action=insert

The application enters in the controller class and uses the insert function?

Is controller a particular keyword of PHP?

  • 写回答

1条回答 默认 最新

  • douyu4535 2015-06-15 10:37
    关注

    MVC is a software architecture - the structure of the system - that separates domain/application/business (whatever you prefer) logic from the rest of the user interface. It does this by separating the application into three parts: the model, the view, and the controller.

    The model manages fundamental behaviors and data of the application. It can respond to requests for information, respond to instructions to change the state of its information, and even to notify observers in event-driven systems when information changes. This could be a database, or any number of data structures or storage systems. In short, it is the data and data-management of the application.

    The view effectively provides the user interface element of the application. It'll render data from the model into a form that is suitable for the user interface.

    The controller receives user input and makes calls to model objects and the view to perform appropriate actions.

    All in all, these three components work together to create the three basic components of MVC.

    Reference MVC means

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?