CakeFest 2024: The Official CakePHP Conference

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

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

Примеры

Пример #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);
}
}
?>

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

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top