how to make url string absolute? In order to get entity link, I'm using:

$entity-&gt;getTranslation($language)-&gt;url();


So it gives me : /en/node/21

But I want this url to be absolute.

How to pass $options = array('absolute' =&gt; TRUE); in above node url?
The options are the second parameter in url(), then you also have to pass the first parameter, which is by default 'canonical':

$entity-&gt;getTranslation($language)-&gt;url('canonical', ['absolute' =&gt; TRUE]);


url() is deprecated, so better use toUrl():

$entity-&gt;getTranslation($language)-&gt;toUrl('canonical', ['absolute' =&gt; TRUE])-&gt;toString();