Files
typo3-13/packages/ep_theme/Classes/ViewHelpers/PriceRangeViewHelper.php
T
frommeandClaude Opus 5.5 3fa4a81e97 chore: remove the outdated copyright notices
The GPL headers named dreipunktnull and an old address and no longer
match the license of the code.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-26 10:41:24 +01:00

35 lines
1015 B
PHP

<?php
namespace EP\EpTheme\ViewHelpers;
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
class PriceRangeViewHelper extends AbstractViewHelper
{
public function initializeArguments()
{
parent::initializeArguments();
$this->registerArgument('min', 'mixed', 'Price range start');
$this->registerArgument('max', 'mixed', 'Price range end');
}
/**
* @param array $arguments
* @param \Closure $renderChildrenClosure
* @param RenderingContextInterface $renderingContext
* @return mixed
*/
public function render()
{
if (1 === (int) $this->arguments['min']) {
return sprintf('bis %d €', $this->arguments['max']);
}
if (999 === (int) $this->arguments['max']) {
return sprintf('ab %d €', $this->arguments['min']);
}
return sprintf('%d bis %d €', $this->arguments['min'], $this->arguments['max']);
}
}