for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
/*
* This file is part of the Extension "sf_event_mgt" for TYPO3 CMS.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*/
namespace DERHANSEN\SfEventMgt\ViewHelpers;
use DERHANSEN\SfEventMgt\PageTitle\EventPageTitleProvider;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
/**
* ViewHelper to render the page title and indexed search title
class TitleViewHelper extends AbstractViewHelper
{
use CompileWithRenderStatic;
public function initializeArguments(): void
parent::initializeArguments();
$this->registerArgument('pageTitle', 'String', 'The page title');
}
public static function renderStatic(
array $arguments,
\Closure $renderChildrenClosure,
RenderingContextInterface $renderingContext
) {
$pageTitle = $arguments['pageTitle'] ?? '';
if ($pageTitle !== '') {
GeneralUtility::makeInstance(EventPageTitleProvider::class)->setTitle($pageTitle);