简体   繁体   English

后端模块中的Typo3 TSFE

[英]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? 也许我完全是瞎子又傻瓜,但是如何在BE Module od typo3 9.5中访问TSFE?

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. 我想在后端模块中使用实际选定站点的某些页面属性,但是自上次使用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. TSFE是“前端的全局对象”,因此您不应依赖于后端中的TSFE。 In TYPO3 v9, you should access the current site object or the Site/Language object for a given page by using the "SiteMatcher" instance. 在TYPO3 v9中,应该使用“ SiteMatcher”实例访问给定页面的当前站点对象或站点/语言对象。 From there, you get the absolute BaseURL. 从那里,您可以获得绝对的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). 实际上,我强烈建议您不要再使用config.baseURL并在TYPO3 v9.5中使用本机站点处理,因为它与Frontend和Backend中的API相同(这就是本意)。

Hope this helps! 希望这可以帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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