Request Lifecycle
The following diagram shows how an application handles a request.
- A user makes a request to the entry script web/index.php.
- The entry script loads the application configuration and creates an
application instance to handle the request. - The application resolves the requested route with the help of the
request application component. - The application creates a controller instance to handle the request.
- The controller creates an action instance and performs the filters
for the action. - If any filter fails, the action is cancelled.
- If all filters pass, the action is executed.
- The action loads a data model, possibly from a database.
- The action renders a view, providing it with the data model.
- The rendered result is returned to the response application
component. - The response component sends the rendered result to the user’s
browser.
本文详细描述了MVC模式下,从用户发起请求到响应返回的完整流程:用户通过web/index.php发送请求,应用加载配置并创建实例,解析路由,创建控制器,执行过滤器,如果过滤器通过则执行相应动作,动作加载数据模型,渲染视图,并将结果通过响应组件回传给用户浏览器。
9891

被折叠的 条评论
为什么被折叠?



