public function addListener($name, $listener, $priority = 0)
    {
        if (! isset($this->listeners[$name])) $this->listeners[$name] = [];
        $this->listeners[$name][$priority][] = $listener;
    }
public function addListener($name, $listener, $priority = 0)
    {
        if (! isset($this->listeners[$name])) $this->listeners[$name] = [];
        $this->listeners[$name][$priority][] = $listener;
    }
public function addListener ( $ name , $ listener , $ priority = 0 ) { if ( ! isset ( $ this -> listeners [ $ name ] ) ) $ this -> listeners [ $ name ] = [ ] ; $ this -> listeners [ $ name ] [ $ priority ] [ ] = $ listener ; }
add event listener

@param   string  $name
@param   mixed   $listener
@param   int     $priority
add event listener