The cUriBuilder cUri helper class allows to create frontend URIs to CONTENIDO articles i.e. frontend URIs to CONTENIDO articles. Usually these URIs look like front_content.php?lang=<lang>&idart=<idart>
. The cUriBuilder cUri allows for totally different URIs e.g. SEO-URIs that contain names of categories and articles instead of the strange looking URI mentioned above. In order to create these URIs independant of the chosen strategy for URI creation it is a good idea to use the cUriBuilder cUri class whose functionality will be explained in this article.
...
Code Block | ||||
---|---|---|---|---|
| ||||
$url = cUri::getInstance()->build(array( 'lang' => cRegistry::getLanguageId(), 'idart' => cRegistry::getArticleId() )); |
Die URI-Klassen mit dem cUriBuilder sind u.a. dafür da, Links für das Frontend zu generieren. Die unterschiedlichen Klassen und deren Verwendungszwecke sowie beispielhafte Implementationen sollen verdeutlichen, wie ein Link generiert werden und beeinflusst werden kann.The called build()-method expects an associative array wich has to have at least values for the keys lang & idart but any parameter can be appended.