MVC request生命周期

来源:互联网 发布:c语言判断数字函数 编辑:程序博客网 时间:2024/06/06 10:56

Request Lifecycle

The following diagram shows how an application handles a request.
这里写图片描述

  1. A user makes a request to the entry script web/index.php.
  2. The entry script loads the application configuration and creates an
    application instance to handle the request.
  3. The application resolves the requested route with the help of the
    request application component.
  4. The application creates a controller instance to handle the request.
  5. The controller creates an action instance and performs the filters
    for the action.
  6. If any filter fails, the action is cancelled.
  7. If all filters pass, the action is executed.
  8. The action loads a data model, possibly from a database.
  9. The action renders a view, providing it with the data model.
  10. The rendered result is returned to the response application
    component.
  11. The response component sends the rendered result to the user’s
    browser.
原创粉丝点击