/**
* Function to convert an internal URI to a route
*
* @param string|array|Uri $url The internal URL or an associative array
*
* @return Uri The absolute search engine friendly URL object
*
* @since 1.5
*/
public function build($url)
{
$key = md5(serialize($url));
if (isset($this->cache[$key])) {
return clone $this->cache[$key];
}
if ($url instanceof Uri) {
$uri = $url;
} else {
$uri = $this->createUri($url);
}
// Do the preprocess stage of the URL build process
$this->processBuildRules($uri, self::PROCESS_BEFORE);
// Do the main stage of the URL build process
$this->processBuildRules($uri);
// Do the postprocess stage of the URL build process
$this->processBuildRules($uri, self::PROCESS_AFTER);
$this->cache[$key] = clone $uri;
return $uri;
}