/** * Returns an uri alias by a given path * * @param string $path * @param bool $emptyOnNoResult * * @return string */ public function getUriAlias($path, $emptyOnNoResult = false) { if ($this->aliasesCache === []) { $this->aliasesCache = $this->seoCache->getCache(); } $path .= !preg_match('/\\/$/', $path) ? '/' : ''; return !empty($this->aliasesCache[$path]['alias']) ? $this->aliasesCache[$path]['alias'] : ($emptyOnNoResult === true ? '' : $path); }
/** * @param string $path * @param string $key * @param string $defaultValue * * @return string */ public function getSeoInformation($path, $key, $defaultValue = '') { // Lazy load the cache if ($this->aliasesCache === null) { $this->aliasesCache = $this->seoCache->getCache(); } $path .= !preg_match('/\\/$/', $path) ? '/' : ''; return !empty($this->aliasesCache[$path][$key]) ? $this->aliasesCache[$path][$key] : $defaultValue; }