略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: Yaf_Dispatcher::registerPlugin

2024-05-02

Yaf_Dispatcher::registerPlugin

(Yaf >=1.0.0)

Yaf_Dispatcher::registerPlugin注册一个插件

说明

public Yaf_Dispatcher::registerPlugin(Yaf_Plugin_Abstract $plugin): Yaf_Dispatcher

Yaf_Bootstrap_Abstract). 注册一个插件(参见 Yaf_Plugin_Abstract)。

参数

plugin

返回值

范例

示例 #1 Yaf_Dispatcher::registerPlugin()example

<?php
class Bootstrap extends Yaf_Bootstrap_Abstract {
  public function 
_initPlugin(Yaf_Dispatcher $dispatcher) {
    
/**
    * Yaf assumes plugin scripts under [application.directory] .  "/plugins" 
    * for this case, it will be:
    * [application.directory] . "/plugins/" . "User" . [application.ext]
    */ 
    
$user = new UserPlugin();
    
$dispatcher->registerPlugin($user);
  }
}
?>
add a noteadd a note

User Contributed Notes

There are no user contributed notes for this page.

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

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