Yaf_Dispatcher::registerPlugin

(Yaf >=1.0.0)

Yaf_Dispatcher::registerPlugin — Register a plugin


Описание

public Yaf_Dispatcher Yaf_Dispatcher::registerPlugin ( Yaf_Plugin_Abstract $plugin )

Register a plugin(see Yaf_Plugin_Abstract). Generally, we register plugins in Bootstrap(see Yaf_Bootstrap_Abstract).


Список параметров

plugin -


Возвращаемые значения


Примеры

Пример #1 Yaf_Dispatcher::registerPlugin()example

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);
  }
}

Смотрите также


User Contributed Notes


There are no user contributed notes for this page.

Описание на ru2.php.net
Описание на php.ru