...
You can give the data as a default URI too. In this case the given URI is parsed (see below) before building it anewaccording to the defined builder.
Code Block |
---|
language | php |
---|
linenumbers | true |
---|
|
$url = "front_content.php?idart=$idart&lang=$lang";
$url = cUri::getInstance()->build($url); |
...
The cUri class also offers a parse()
method which allows for splitting an URI any URI (n.b. not only CONTENIDO URIs) into its components (thats what the PHP function parse_url does) which is extended by the key 'params' that contains name, value pairs for each parameter of the given URI.
Code Block |
---|
language | php |
---|
linenumbers | true |
---|
|
$components = cUri::getInstance()->parse($url);
|
A parsed URI can be rebuild using the method composeByComponents()
.
Code Block |
---|
language | php |
---|
linenumbers | true |
---|
|
$url = |
...
cUri::getInstance()->composeByComponents($components); |
Examine an URI
The methods isExternalUrl() and isIdentifiableFrontContentUrl() allow to examine any URI for being an external URI.
Retrieve current builder
The builder that is currently configured can be retrieved like that:
Code Block |
---|
language | php |
---|
linenumbers | true |
---|
|
$builder = cUri::getInstance()->getUriBuilder(); |
cUriBuilderFactory & cUriBuilder
cUriBuilderCustom
cUriBuilderCustomPath
cUriBuilderFrontcontent
cUriBuilderMR
cUriBuilderConfig