public static function on($class, $name, $handler, $data = null, $append = true)
    {
    	$class = Ioc::resolveClassName($class);
    	
        if ($append || empty(self::$_events[$name][$class])) {
            self::$_events[$name][$class][] = [$handler, $data];
        } else {
            array_unshift(self::$_events[$name][$class], [$handler, $data]);
        }
    }
public static function on($class, $name, $handler, $data = null, $append = true)
    {
    	$class = Ioc::resolveClassName($class);
    	
        if ($append || empty(self::$_events[$name][$class])) {
            self::$_events[$name][$class][] = [$handler, $data];
        } else {
            array_unshift(self::$_events[$name][$class], [$handler, $data]);
        }
    }
public static function on ( $ class , $ name , $ handler , $ data = null , $ append = true ) { $ class = Ioc :: resolveClassName ( $ class ) ; if ( $ append || empty ( self :: $ _events [ $ name ] [ $ class ] ) ) { self :: $ _events [ $ name ] [ $ class ] [ ] = [ $ handler , $ data ] ; } else { array_unshift ( self :: $ _events [ $ name ] [ $ class ] , [ $ handler , $ data ] ) ; } }
bind a class-level event.

When a class-level event is triggered, event handlers attached
to that class and all parent classes will be invoked.

~~~
Event::on('Ns\Test', 'before_insert', function ($event) {
log(get_class($event->sender) . ' is inserted.');
});
~~~

@param mixed    $class object or fully qualified class name
@param string   $name the event name.
@param callable $handler the event handler.
@param mixed    $data can access $event->data() when the event is triggered.
@param boolean  $append append or prepend default append
bind a class - level event .