Static Public Member Functions | |
| static | build ($path, $parameters=null) |
| Build a URL from the passed parameters. | |
| static | parse ($url) |
| Parse a URL into a path and an array of query parameters. | |
Definition at line 14 of file url.lib.php.
| static AnewtURL::build | ( | $ | path, | |
| $ | parameters = null | |||
| ) | [static] |
Build a URL from the passed parameters.
You can provide a single path string, or an array of strings, in which case each of the items in $path is a path component. The path components will be concatenated, separated by slashes.
All slashes are normalized. If the first path component has a leading slash, the resulting string will also have a leading slash and if it doesn't, the resulting string won't have one either. The same goes for the trailing slash: if the last path component ends with a slash, the resulting string will have one as well.
If $parameters is passed, a HTTP query string will be appended to the url using the this associatve array.
Example:
$url = AnewtURL::join(array('/path/to', $file), array('foo' => 'bar'));
| $path | Single string or array of strings (each item is a path component of the url) | |
| $parameters | Associative array used to build a query string (optional) |
Definition at line 48 of file url.lib.php.
| static AnewtURL::parse | ( | $ | url | ) | [static] |
Parse a URL into a path and an array of query parameters.
This is (partly) the inverse operation of inverse AnewtURL::build() and can be used to parse an url into a path and query parameters (the GET string).
| $url | string The url to parse. |
Definition at line 189 of file url.lib.php.
1.5.9