Yaf_Dispatcher::registerPlugin

(Yaf >=1.0.0)

Yaf_Dispatcher::registerPluginプラグインを登録する

説明

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

プラグイン (Yaf_Plugin_Abstract を参照) を登録します。ふつうは、プラグインの登録はブートストラップ (Yaf_Bootstrap_Abstract を参照) で行います。

パラメータ

plugin

戻り値

例1 Yaf_Dispatcher::registerPlugin() の例

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

User Contributed Notes

There are no user contributed notes for this page.
To Top