The UrlShortener plugin provides an overview of all defined short URLs for articles and allows for editing or deleting them. |
This plugin offers the classes cApiShortUrlCollection and cApiShortUrl which allow for creating and validating short URIs.
The class cApiShortUrlCollection offers the method create() which expects at least a short URI which is given as first parameter $uri. The latter parameters ($idart, $idlang, $idclient) are optional and are taken from cRegistry (getArticleId(), getLanguageId() and getClientId() respectivly) if not set.
$coll = new cApiShortUrlCollection(); /** @var cApiShortUrl */ $item = $coll->create($uri, $idart, $idlang, $idclient); |
In order to check if an URI is a valid short URI you can use the collections method isValidShortUrl() which expects an URI as single parameter. The check will be performed with the following criteria:
$coll = new cApiShortUrlCollection(); $coll->isValidShortUrl($uri); |
This method returns either true or an errorcode:
Area/Type | Name | Description | Default | Scope |
---|---|---|---|---|
url_shortener | domain | n/a | SCGU |