Yet Another Framework Yaf_Dispatcher::registerPlugin

(Yaf >=1.0.0)

Yaf_Dispatcher::registerPlugin — 플러그인 등록


설명

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

플러그인을 등록합니다(Yaf_Plugin_Abstract 참조). 일반적으로 Bootstrap에 플러그인을 등록합니다(Yaf_Bootstrap_Abstract 참조).


매개변수

plugin

반환 값


Examples

예제 #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);
  }
}
?>
                  
                

기타