$url = \TYPO3\CMS\Core\Utility\GeneralUtility::getURL(123); echo 'Link to page 123';
$path = 'fileadmin/documents/myfile.pdf'; $url = \TYPO3\CMS\Core\Utility\GeneralUtility::getURL($path); echo 'Download my file';
$url = \TYPO3\CMS\Core\Utility\GeneralUtility::getURL('https://www.google.com', true); echo 'Go to Google';In these examples, we're using the GeneralUtility class to generate URLs for different resources on your website. The package library for these examples is TYPO3's core library.