PHP - Manual: Yaf_Dispatcher::registerPlugin
2024-11-14
(Yaf >=1.0.0)
Yaf_Dispatcher::registerPlugin — 注册一个插件
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);
}
}
?>
官方地址:https://www.php.net/manual/en/yaf-dispatcher.registerplugin.php