PHP Conference Japan 2024

Yaf_Dispatcher 類別

(Yaf >=1.0.0)

簡介

Yaf_Dispatcher 的目的是初始化請求環境,路由傳入的請求,然後分派任何找到的動作;它會彙總所有回應,並在處理完成時傳回它們。

Yaf_Dispatcher 也實作了單例模式,這表示在任何給定時間點只允許存在一個實例。這讓它也能作為一個註冊表,供調度過程中其他物件使用。

類別概要

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 __construct()
public autoRender(bool $flag = ?): Yaf_Dispatcher
public disableView(): bool
public static getInstance(): Yaf_Dispatcher
public initView(string $templates_dir, array $options = ?): Yaf_View_Interface
public setErrorHandler(callable $callback, int $error_types): Yaf_Dispatcher
}

屬性

_router

_view

_request

_plugins

_instance

_auto_render

_return_response

_instantly_flush

_default_module

_default_controller

_default_action

目錄

新增筆記

使用者貢獻的筆記

此頁面沒有使用者貢獻的筆記。
To Top