toString(); ?>
toString(); } // Display current URL echo getCurrentURL(); ?>These examples show how to use the JFactory getUri method to retrieve the current page URL. It belongs to the Joomla\CMS\Factory class, which is bundled in the Joomla CMS as part of the core package. The JFactory getUri function allows developers to easily access the current page URL in their code instead of manually creating the current URL's string.