CakeFest 2024: The Official CakePHP Conference

Yaf_Dispatcher::dispatch

(Yaf >=1.0.0)

Yaf_Dispatcher::dispatch分发请求

说明

public Yaf_Dispatcher::dispatch(Yaf_Request_Abstract $request): Yaf_Response_Abstract

Yaf_Dispatcher 的这个方法做的工作很繁重.它需要 request 对象。

分发过程有三个不同的事件:

  • 路由
  • 分发
  • 响应
当调用 Yaf_Dispatcher::dispatch() 时,路由只发生一次,使用请求对象中的值。分发发生在循环中;一个请求可能会分发出多个动作,或者 controller 或 plugin 可能重置请求对象来强制分发其它动作(参见 Yaf_Plugin_Abstract)。当所有都执行完毕,Yaf_Dispatcher 返回响应。

参数

request

返回值

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top