Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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
languagephp
linenumberstrue
$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
languagephp
linenumberstrue
$components = cUri::getInstance()->parse($url);

A parsed URI can be rebuild using the method composeByComponents().

Code Block
languagephp
linenumberstrue
$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
languagephp
linenumberstrue
$builder = cUri::getInstance()->getUriBuilder();

cUriBuilderFactory & cUriBuilder

cUriBuilderCustom

cUriBuilderCustomPath

cUriBuilderFrontcontent

cUriBuilderMR

cUriBuilderConfig