GetPreferencesViewHelper.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace Opentalent\OtTemplating\ViewHelpers\Template;
  3. use Closure;
  4. use Opentalent\OtTemplating\Page\OtPageRepository;
  5. use TYPO3\CMS\Core\Utility\GeneralUtility;
  6. use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
  7. use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
  8. /**
  9. * Returns the recorded preferences
  10. *
  11. * {namespace ot=Opentalent\OtTemplating\ViewHelpers}
  12. *
  13. * {ot:template.preferences()}
  14. *
  15. * @package Opentalent\OtTemplating\ViewHelpers\Template
  16. */
  17. class PreferencesViewHelper extends AbstractViewHelper
  18. {
  19. /**
  20. * -- This method is expected by Fluid --
  21. * Renders the content as html
  22. *
  23. * @param array $arguments
  24. * @param Closure $renderChildrenClosure
  25. * @param RenderingContextInterface $renderingContext
  26. * @return array
  27. */
  28. public static function renderStatic(
  29. array $arguments,
  30. Closure $renderChildrenClosure,
  31. RenderingContextInterface $renderingContext
  32. ) {
  33. $pageRepository = GeneralUtility::makeInstance(OtPageRepository::class);
  34. return $pageRepository->getTemplatePreferences();
  35. }
  36. }