$myShortUri = "http://www.veryshorturi.domain";
// create new short URI collection
$shortUriCol = new cApiShortUrlCollection();
// create short URI
// first param string short uri you want
// second param optional idart, if no idart set, function use cRegistry::getArticleId()
// third param optional idlang, if no idlang set, function use cRegistry::getLanguageId()
// fourth param optional idclient, if no idclient set, function use cRegistry::getClientId()
$shortUrlItem = $shortUriCol ->create($myShortUri, $idart, $idlang, $idclient);
// validate short uri
$shortUrlItem->isValidShortUrl($myShortUri); |