Function : domUrl

The domUrl() function is used to map static files to the current window as long as the path is accessible. Assuming we have a file in the global res/ directory. We can map the file easily by using the domurl() function. This will ensure that the file loaded is properly mapped to the current window on either a local or a remote url.

 echo domurl('res/some-image.jpg');
                  

The value returned above will resemble a format like:
 http://domain/res/some-image.jpg
                  

The domain section can be localhost/project_folder or some online domain like somesite.com. This behavior is handled internally depending on the current environment of work. Also, when this function is used, the last url supplied is usually tracked by default. Which can be obtained later from the Domurl class.
 echo domurl('res/some-image.jpg');

 echo GET(DomUrl::last()); // http://domain/res/some-image.jpg
                  

Note that the tracking of supplied urls is useful within template files. However, the path tracking may be avoided by setting the second argument as false .