diff --git a/flight/core/EventDispatcher.php b/flight/core/EventDispatcher.php index 0553dc7..828388c 100644 --- a/flight/core/EventDispatcher.php +++ b/flight/core/EventDispatcher.php @@ -33,7 +33,12 @@ class EventDispatcher { if (isset($this->listeners[$event]) === true) { foreach ($this->listeners[$event] as $callback) { - call_user_func_array($callback, $args); + $result = call_user_func_array($callback, $args); + + // If you return false, it will break the loop and stop the other event listeners. + if ($result === false) { + break; // Stop executing further listeners + } } } }