src/Event.php
public static function trigger($class, $name, Event $event = null)
    {
        if (empty(static::$events)) {
            return;
        }
        if ($event === null) {
            $event = new static;
        }
        $event->handled = false;
        $event->name = $name;

        if (is_object($class)) {
            if ($event->owner === null) {
                $event->owner = $class;
            }
            $class = get_class($class);
        } else{
            $class = ltrim($class, '\\');
        }

        do {
            if (!empty(static::$events[$class][$name])) {
                foreach (static::$events[$class][$name] as $handler) {
                    call_user_func($handler, $event);
                    if ($event->handled) {
                        return;
                    }
                }
                //static::off($class, $name);
            }
        } while (($class = get_parent_class($class)) !== false);
    }
public static function trigger($class, $name, Event $event = null)
    {
        if (empty(static::$events)) {
            return;
        }
        if ($event === null) {
            $event = new static;
        }
        $event->handled = false;
        $event->name = $name;

        if (is_object($class)) {
            if ($event->owner === null) {
                $event->owner = $class;
            }
            $class = get_class($class);
        } else{
            $class = ltrim($class, '\\');
        }

        do {
            if (!empty(static::$events[$class][$name])) {
                foreach (static::$events[$class][$name] as $handler) {
                    call_user_func($handler, $event);
                    if ($event->handled) {
                        return;
                    }
                }
                //static::off($class, $name);
            }
        } while (($class = get_parent_class($class)) !== false);
    }
public static function trigger ( $ class , $ name , Event $ event = null ) { if ( empty ( static :: $ events ) ) { return ; } if ( $ event === null ) { $ event = new static ; } $ event -> handled = false ; $ event -> name = $ name ; if ( is_object ( $ class ) ) { if ( $ event -> owner === null ) { $ event -> owner = $ class ; } $ class = get_class ( $ class ) ; } else { $ class = ltrim ( $ class , '\\' ) ; } do { if ( ! empty ( static :: $ events [ $ class ] [ $ name ] ) ) { foreach ( static :: $ events [ $ class ] [ $ name ] as $ handler ) { call_user_func ( $ handler , $ event ) ; if ( $ event -> handled ) { return ; } } //static::off($class, $name); } } while ( ( $ class = get_parent_class ( $ class ) ) !== false ) ; }
Publishing event.

@param string|object $class the object or the fully qualified class name specifying the class-level event.
@param string $name the event name.
@param Event $event the event parameter. If not set, a default [[Event]] object will be created.
Publishing event .