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');
http://domain/res/some-image.jpg
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
false .