简体   繁体   中英

Typo3 TSFE in Backend module

Maybe I'm completely blind and a fool, but how can I access TSFE in BE Module od typo3 9.5?

I'd like to use some Page-Properties of the actual selected site in Backend modules, but I have no idea how to get this since the last time I used it was under pi_based.

  \TYPO3\CMS\Core\Utility\DebugUtility::debug(
          $GLOBALS['TSFE']->tmpl->setup['config.']['baseURL']
       );

This won't work and i am stucking :( Kind regards and thx in advance

Tom

TSFE is the "global object for Frontend", so you should not rely on TSFE in Backend. In TYPO3 v9, you should access the current site object or the Site/Language object for a given page by using the "SiteMatcher" instance. From there, you get the absolute BaseURL.

In fact, I highly recommend not using config.baseURL anymore and use native Site Handling in TYPO3 v9.5, as it is the same API in Frontend and Backend (that's what it was meant to be).

Hope this helps!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM