Versions Compared

Key

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

...

Code Block
languagephp
linenumberstrue
$url = cUri::getInstance()->composeByComponents($components);

Examine an URI

The methods method isExternalUrl() and allow to examine any URI for being an external URI.

The method isIdentifiableFrontContentUrl() allow to examine any URI for being an external URI.internal URI. Following URLs will be identified as an internal URL:

  • "/", "/?idart=123", "/?idcat=123", ...
  • "front_content.php", "front_content.php?idart=123", "front_content.php?idcat=123", ...
  • "/front_content.php", "/front_content.php?idart=123", "/front_content.php?idcat=123", ...
  • The path component of an client HTML base path: e. g. "/cms/", "/cms/?idart=123", "/cms/?idcat=123"
  • Also possible: "/cms/front_content.php", "/cms/front_content.php?idart=123", "/cms/front_content.php?idcat=123"

All of them prefixed with protocol and client host (e. g. http://host/) will also be identified as a internal Url.

Other Urls, even internal Urls like /unknown/path/to/some/page.html will not be identified as internal url event if they are real working clean URLs.

Retrieve current builder

The builder that is currently configured can be retrieved like that:

...

Builders allow to build an URI using the abstract public function buildUrl(). In order to retrieve the built URI the method getUrl() has to be used. 

Code Block
languagephp
linenumberstrue
cUriBuilderFrontcontent::getInstance()->buildUrl($param, $absolute);
$url = cUriBuilderFrontcontent::getInstance()->getUrl();

...

Configure cUriBuilder URL style. Per default, configures for style index-a-1.html. If you need another style, extend this class to your needs and pass it to desired cUriBuilder. The cUriBuilderConfig::setConfig() must be called at least once to initialize the desired UriBuilder. 

Code Block
languagephp
titleExample for default front_content cUriBuilder
linenumberstrue
$myCfg['name'] = 'front_content';
$myCfg['config'] = array();
cUriBuilderConfig::setConfig($myCfg);

...