From Joomla! Documentation

Revision as of 12:23, 19 December 2019 by Robbiej (talk | contribs) (link to URLs in Joomla)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

(The text of this page has been subsumed into the article URLs in Joomla).

Example of Get and Set Methods

Get and set methods are provided for all the component parts of a URI. The following names of the component parts are used:
     \__/   \________/ \________/ \_____________/ \__/\_______________________/ \_____________/ \________/
      |          |         |              |        |              |                    |            |
   scheme      user       pass          host      port          path                 query       fragment

The example column in the following table illustrates the result of each of the get methods on the URI above.

Get method Set method Description Example
getFragment setFragment Fragment (everything after the '#'). This is often referred to as an anchor. anchorthis
getHost setHost Hostname or IP address. For example, '' or ''.
getPass setPass Password part of the authority. itsasecret
getPath setPath Path string. Note that the path always includes the leading "/" character. /path/to/Joomla/index.php
getPort setPort Port number. Specific schemes (protocols) have their own defaults (for example, 'http' is port 80, 'ftp' is port 21). 8080
getQuery setQuery Query in string format. For example, "foo=bar&x=y". See also buildQuery. task=view&id=32
getScheme setScheme Scheme (protocol). For example, 'http', 'https', 'ftp'. http
getUser setUser Username part of the authority. fredbloggs
getVar setVar An individual query item value from within the query part. See also delVar. 32

Chris Davenport 13:17, 17 April 2011 (CDT) Edit comment