array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'ja', ), 'this' => array ( 0 => 'yaf-dispatcher.registerplugin.php', 1 => 'Yaf_Dispatcher::registerPlugin', ), 'up' => array ( 0 => 'class.yaf-dispatcher.php', 1 => 'Yaf_Dispatcher', ), 'prev' => array ( 0 => 'yaf-dispatcher.initview.php', 1 => 'Yaf_Dispatcher::initView', ), 'next' => array ( 0 => 'yaf-dispatcher.returnresponse.php', 1 => 'Yaf_Dispatcher::returnResponse', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'ja', 'path' => 'reference/yaf/yaf_dispatcher/registerplugin.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(Yaf >=1.0.0)
Yaf_Dispatcher::registerPlugin — プラグインを登録する
プラグイン (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);
}
}
?>