Yaf_Dispatcher 類

(Yaf >=1.0.0)

簡(jiǎn)介

Yaf_Dispatcher用于初始化處理請(qǐng)求的運(yùn)行環(huán)境, 它協(xié)調(diào)路由來(lái)的請(qǐng)求, 并分發(fā)和執(zhí)行發(fā)現(xiàn)的動(dòng)作, 然后收集動(dòng)作產(chǎn)生的響應(yīng), 輸出響應(yīng)給請(qǐng)求者, 并在整個(gè)過(guò)程完成以后返回響應(yīng).

Yaf_Dispatcher是單例模式運(yùn)行的, 也就是說(shuō)自始至終只生成一個(gè)Yaf_Dispatcher實(shí)例, 因此, 可以把它看成是在分發(fā)過(guò)程中生成的對(duì)象的注冊(cè)表, 可以從中獲取到分發(fā)過(guò)程中產(chǎn)生的對(duì)象.

類摘要

final class Yaf_Dispatcher {
/* 屬性 */
protected $_router;
protected $_view;
protected $_request;
protected $_plugins;
protected static $_instance;
protected $_auto_render;
protected $_default_module;
protected $_default_action;
/* 方法 */
public autoRender(bool $flag): Yaf_Dispatcher
public catchException(bool $flag = ?): Yaf_Dispatcher
public__construct()
public disableView(): bool
public flushInstantly(bool $flag): Yaf_Dispatcher
public getDefaultAction(): string
public getDefaultController(): string
public getDefaultModule(): string
public static getInstance(): Yaf_Dispatcher
public initView(string $templates_dir, array $options = ?): Yaf_View_Interface
public returnResponse(bool $flag): Yaf_Dispatcher
public setDefaultAction(string $action): Yaf_Dispatcher
public setDefaultController(string $controller): Yaf_Dispatcher
public setDefaultModule(string $module): Yaf_Dispatcher
public setErrorHandler(call $callback, int $error_types): Yaf_Dispatcher
public throwException(bool $flag = ?): Yaf_Dispatcher
}

屬性

_router

_view

_request

_plugins

_instance

_auto_render

_return_response

_instantly_flush

_default_module

_default_controller

_default_action

目錄