Files
typo3-13/packages/ep_theme/Classes/ViewHelpers/ThemeClassesViewHelper.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

33 lines
914 B
PHP

<?php
namespace EP\EpTheme\ViewHelpers;
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
class ThemeClassesViewHelper extends AbstractViewHelper
{
public function initializeArguments()
{
parent::initializeArguments();
$this->registerArgument('key', 'string', 'The theme key', false, 'ep');
$this->registerArgument('classes', 'array', 'The classes to apply per theme key', true);
}
/**
* @param array $arguments
* @param \Closure $renderChildrenClosure
* @param RenderingContextInterface $renderingContext
* @return mixed
*/
public function render()
{
$themeKey = $this->arguments['key'];
if (!array_key_exists($themeKey, $this->arguments['classes'])) {
return '';
}
return $this->arguments['classes'][$themeKey];
}
}