UriViewHelper.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. * Return the URI of the requested page
  8. *
  9. * {namespace ot=Opentalent\OtTemplating\ViewHelpers}
  10. *
  11. * {ot:request.uri()}
  12. *
  13. * @package Opentalent\OtTemplating\ViewHelpers
  14. */
  15. class UriViewHelper extends OtAbstractViewHelper {
  16. /**
  17. * -- This method is expected by Fluid --
  18. * Declares the viewhelper's parameters
  19. */
  20. public function initializeArguments()
  21. {
  22. }
  23. /**
  24. * -- This method is expected by Fluid --
  25. * Renders the content as html
  26. *
  27. * @param array $arguments
  28. * @param Closure $renderChildrenClosure
  29. * @param RenderingContextInterface $renderingContext
  30. * @return string|null
  31. */
  32. public static function renderStatic(
  33. array $arguments,
  34. Closure $renderChildrenClosure,
  35. RenderingContextInterface $renderingContext
  36. ) {
  37. return (string)$GLOBALS['TYPO3_REQUEST']->getUri();
  38. }
  39. }