In this guide below it's not considered.)īase() and root() are static functions which return key URLs. (Note that passing the user/password in the URL in this fashion is generally deprecated and not recommended, and won't work on some browsers. A query parameter may be removed using delVar. Don't use this!Īn individual query item value from within the query part. Specific schemes (protocols) have their own defaults (for example, 'http' is port 80, 'ftp' is port 21). Note that the path always includes the leading '/' character.
The example column in the following table illustrates the result of each of the get methods on the URI above, all of which are strings.įragment (everything after the '#'). Scheme user pass host port path query fragment What gets returned from Uri::getInstance() isn't a PHP string of the URL, but rather a Joomla Uri object, which also holds internally the various parts of the URL, and provides getter and setter methods to read or write these URL parts as shown \_/ \_/ \_/ \_/\_/ \_/ \_/ Apache or IIS) and also performs some cleaning of the URL to avoid some types of injection attacks.
The advantage of using this method is that it handles any peculiarities of the webserver (e.g.