GetWebsiteViewHelper.php 963 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. namespace Opentalent\OtTemplating\ViewHelpers\Request;
  3. use Closure;
  4. use Opentalent\OtCore\ViewHelpers\OtAbstractViewHelper;
  5. use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
  6. /**
  7. * Returns the current Typo3 OtWebsite (FE only)
  8. *
  9. * {namespace ot=Opentalent\OtTemplating\ViewHelpers}
  10. *
  11. * {ot:request.getWebsite()}
  12. *
  13. * @package Opentalent\OtTemplating\ViewHelpers
  14. */
  15. class GetWebsiteViewHelper extends OtAbstractViewHelper {
  16. /**
  17. * -- This method is expected by Fluid --
  18. * Renders the content as html
  19. *
  20. * @param array $arguments
  21. * @param Closure $renderChildrenClosure
  22. * @param RenderingContextInterface $renderingContext
  23. * @return string|null
  24. */
  25. public static function renderStatic(
  26. array $arguments,
  27. Closure $renderChildrenClosure,
  28. RenderingContextInterface $renderingContext
  29. ) {
  30. return $GLOBALS['TSFE']->getAttribute('ot_website');
  31. }
  32. }