Skip to content

Instantly share code, notes, and snippets.

@CB9TOIIIA
Created November 2, 2017 12:24
Show Gist options
  • Save CB9TOIIIA/9f4041160ab1f6c44f12785d6fb6ffb9 to your computer and use it in GitHub Desktop.
Save CB9TOIIIA/9f4041160ab1f6c44f12785d6fb6ffb9 to your computer and use it in GitHub Desktop.
sef url joomla
JLoader::register('ContentHelperRoute', JPATH_SITE . '/components/com_content/helpers/route.php');
$rootURL = rtrim(JURI::base(),'/');
$subpathURL = JURI::base(true);
if(!empty($subpathURL) && ($subpathURL != '/')) {
$rootURL = substr($rootURL, 0, -1 * strlen($subpathURL));
}
$itemUrl = $rootURL.JRoute::_(ContentHelperRoute::getArticleRoute($item->id, $item->catid));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment