This class makes handling URL:s easy.
Located in /Url.php (line 32)
The fragment.
The hidden path info parameters.
So that the created URL:s can be kept even more neat looking, it's possible to not have name-value attribute pairs as the path info parameters but instead not store the name part in the URL and refeer to the value part with the index of it. So this array just indicates if an attribute should be hidden, i.e. the name part shouldn't be shown or not.
The host name.
The password to use.
The path.
The path info parameters.
This is used when one wants to get "cleaner" urls. Compare http://foo.bar/foo.php?id=5&sort=asc&start=50 with http://foo.bar/foo.php/id/5/sort/asc/start/50 and if you add logic to access the path info parameters by index it can be redused to: http://foo.bar/foo.php/5/asc/50 or something like that.
The port number to use.
The query parameters.
The scheme; http, https etc.
Indicator telling if the session parameter should be included in the generated URL or not.
Indicates if the last path-info parameter should be omitted if possible.
This is used to avoid the default action name at the end of the URL:s if it's not needed.
The user name to use.
The constructor.
If it's an internal url the session identifier will automatically be added to the url if it's necessary (i.e. if cookies are disabled in the user's browser). If it's not an internal url no session identifier will be added. An internal url is identified by the value of the $internal parameter. If it's ISMO_CORE_QUERY_STYLE or ISMO_CORE_PATHINFO_STYLE it's considered an internal url. ISMO_CORE_QUERY_STYLE is the default value for that parameter.
Because this method can't know what is the script and what is additional path info data. The whole path is considered to be part of the path to the script. So additional path info parameters have to be added with the addPathParameter() method.
Adds a query parameter to the url.
If a parameter with the same name has already been added it will be updated instead of added again.
Example:
This results in a url like this, http://foo/bar.php?sort=asc
- $url = new Ismo_Core_Url('http://foo/bar.php');
- $url->addParameter('sort', 'asc');
Adds a path parameter to the url.
If a parameter with the same name has already been added it will be updated instead of added again.
Examples:
This results in a url like this, http://foo/bar.php/sort/asc
- $url = new Ismo_Core_Url('http://foo/bar.php');
- $url->addPathParameter('sort', 'asc');
This results in a url like this, http://foo.bar.php/asc. I.e. the name of the parameter is hidden and to get the value of this parameter one has to use the getPathParameterByIndex() method.
- $url = new Ismo_Core_Url('http://foo/bar.php');
- $url->addPathParameter('sort', 'asc', false);
Adds path parameters to the url, using an indexed array.
Note that you have to url encode params yourself, if needed.
Adds path parameters to the url, using an assoc. array.
Note that you have to url encode params yourself, if needed.
Removes a parameter from the url.
Removes a path info parameter from the url.
Returns the URL in a string format suitable to put in HTML.
The URL is always returned in a absolute format.
Adds path parameters to the url.
Note that you have to url encode params yourself, if needed.
Returns the path info parameters as a string.
Returns the query parameters as a string.
Documentation generated on Mon, 14 Jun 2004 11:59:39 +0200 by phpDocumentor 1.3.0RC3