array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'ru', ), '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' => 'ru', '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). Как правило, мы регистрируем плагины в Bootstrap (смотрите Yaf_Bootstrap_Abstract).
plugin
Пример #1 Пример использования Yaf_Dispatcher::registerPlugin()
<?php
class Bootstrap extends Yaf_Bootstrap_Abstract {
public function _initPlugin(Yaf_Dispatcher $dispatcher) {
/**
* Yaf ожидает скрипты плагинов в [application.directory] . "/plugins"
* для этого случая будет:
* [application.directory] . "/plugins/" . "User" . [application.ext]
*/
$user = new UserPlugin();
$dispatcher->registerPlugin($user);
}
}
?>