public function on($name, $key, Closure $fn = null)
    {
        $name = strtolower($name);
        if ($key instanceof Closure) {
            $this->rules['event'][$name][''] = $key;
        } else {
            $this->rules['event'][$name][$key] = $fn;
        }
        return $this;
    }
public function on($name, $key, Closure $fn = null)
    {
        $name = strtolower($name);
        if ($key instanceof Closure) {
            $this->rules['event'][$name][''] = $key;
        } else {
            $this->rules['event'][$name][$key] = $fn;
        }
        return $this;
    }
public function on ( $ name , $ key , Closure $ fn = null ) { $ name = strtolower ( $ name ) ; if ( $ key instanceof Closure ) { $ this -> rules [ 'event' ] [ $ name ] [ '' ] = $ key ; } else { $ this -> rules [ 'event' ] [ $ name ] [ $ key ] = $ fn ; } return $ this ; }
Adds a rule to handle user event, such as click, subscribe

@param string $name
@param Closure|string $key
@param Closure $fn
@return $this
Adds a rule to handle user event such as click subscribe