Typo3 Dev: Get Base URL in Extension
There are two ways to get the base URL in your Code, either you use:
print $GLOBALS['TSFE']->baseUrl;
or from your TypoScript configuration use:
print $GLOBALS['TSFE']->tmpl->setup['config.']['baseURL'];
Be careful, you have to set the baseURL in your TypoScript or both options won’t work at all.
Cheers
Related posts
- Typo3 Extension – Get translation overlay of your records
- Change Head Title, Meta Description and Meta Keywords from within your Extension
- Typo3 seo_basics add Title Tag from Extension
- Typo3 Extension Flexform, outsourcing Language Files for your flexform
- How to make your Mac recognize Browser HTML Tabindex?
