略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: Yaf_Dispatcher

2024-12-22

Yaf_Dispatcher 类

(Yaf >=1.0.0)

简介

Yaf_Dispatcher用于初始化处理请求的运行环境, 它协调路由来的请求, 并分发和执行发现的动作, 然后收集动作产生的响应, 输出响应给请求者, 并在整个过程完成以后返回响应.

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 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

目录

add a noteadd a note

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/class.yaf-dispatcher.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3