MVC Micro Framework
Event Dispatcher
Event Dispatcher is another component in MVC Micro Framework. It is a simple implementation of design pattern Observer.
Event Dispatcher
Event
Event Dispatcher is a simple implementation of the Observer design pattern and is based on PSR-14 standards. It's easy to use. Just create Event and Dispatcher objects.
 1$this->eventDispatcher = new Dispatcher();
 2$this->callDatabase = new Event("database");
 3
 4$this->eventDispatcher->attach($this->callDatabase, array($this, 'getDatabaseInstance'));
 1public function template()
 2{
 3$this->eventDispatcher->dispatch($this->callDatabase);
 4}