(Yaf >=1.0.0)
Yaf_Dispatcher::registerPlugin — Register a plugin
$plugin): Yaf_Dispatcher|null|falseRegister a plugin (see Yaf_Plugin_Abstract). Generally, plugins are registered in Bootstrap (see Yaf_Bootstrap_Abstract).
pluginA Yaf_Plugin_Abstract instance.
Returns the Yaf_Dispatcher object itself on
success, or false / null on failure.
Example #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);
}
}
?>