How to create external URL from component info

I’m looking for a helper function of some sort which allows me to pass in components for an (potentially external) URL like this:

public static function getURL ($host=null, $path=null, $args=array(), $fragment=null, $ssl=false)

Does something like this exist? It seems that Uri::createFromString() could be used for this, but this requires me to assemble the URL anyhow, so it kind of defeats the purpose.

Thanks for any pointers.

You already fount the Url class. Won’t its constructor suffice?

1 Like

It should, I have no idea how I missed that. Thanks for pointing me into the right direction.