protected function url($path = '', $query = [])
    {
        $path = $this->urlBase() . $path;
        $query = http_build_query(array_merge($this->params, $query));

        $url = $path;
        if (!empty($query)) {
            $url .= '?' . $query;
        }

        return $url;
    }
protected function url($path = '', $query = [])
    {
        $path = $this->urlBase() . $path;
        $query = http_build_query(array_merge($this->params, $query));

        $url = $path;
        if (!empty($query)) {
            $url .= '?' . $query;
        }

        return $url;
    }
protected function url ( $ path = '' , $ query = [ ] ) { $ path = $ this -> urlBase ( ) . $ path ; $ query = http_build_query ( array_merge ( $ this -> params , $ query ) ) ; $ url = $ path ; if ( ! empty ( $ query ) ) { $ url .= '?' . $ query ; } return $ url ; }
Build a relative URL for a resource.

@param string $path
@param array  $query

@return string
Build a relative URL for a resource .