Добро пожаловать на форум PHP программистов!
За последние 24 часа нас посетили 17244 программиста и 1834 робота. Сейчас ищут 1692 программиста ...

Event_Dispatcher::addNestedDispatcher

Вернуться к: Event_Dispatcher

Event_Dispatcher::addNestedDispatcher

Event_Dispatcher::addNestedDispatcher() – Add a nested dispatcher.

Synopsis

require_once 'Event/Dispatcher.php';

void Event_Dispatcher::addNestedDispatcher ( object Event_Dispatcher &$dispatcher )

Adds a nested dispatcher to the dispatcher.

Nested dispatchers allow you to create event bubbling like it is implemented in Javascript. After an event has been posted to all observers of the dispatcher, it will be broadcasted to all nested dispatchers.

If you have one dispatcher that dispatches events of a component in your framework and one dispatcher that dispatches global events that are triggered by the framework itself it could make sense that you nest these dispatchers, so that events posted by the component dispatcher will also be broadcasted to the global dispatcher.

Parameter

  • object Event_Dispatcher &$dispatcher

    Dispatcher that should be added as a nested dispatcher to the current dispatcher.

Return value

void

Note

This function can not be called statically.



Вернуться к: Event_Dispatcher

© 2024 «PHP.RU — Сообщество PHP-Программистов»
Главная | Форум | Реклама на сайте | Контакты VIP Сувениры
Разработка компании ODware