‪TYPO3CMS  ‪main
NonceViewHelper.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
21 use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
22 
37 final class ‪NonceViewHelper extends AbstractViewHelper
38 {
39  public function ‪__construct(private readonly ‪RequestId $requestId) {}
40 
41  public function ‪initializeArguments(): void
42  {
43  parent::initializeArguments();
44  }
45 
46  public function ‪render(): string
47  {
48  return $this->requestId->nonce->consume();
49  }
50 }
‪TYPO3\CMS\Fluid\ViewHelpers\Security\NonceViewHelper\render
‪render()
Definition: NonceViewHelper.php:46
‪TYPO3\CMS\Fluid\ViewHelpers\Security\NonceViewHelper\initializeArguments
‪initializeArguments()
Definition: NonceViewHelper.php:41
‪TYPO3\CMS\Core\Core\RequestId
Definition: RequestId.php:26
‪TYPO3\CMS\Fluid\ViewHelpers\Security\NonceViewHelper
Definition: NonceViewHelper.php:38
‪TYPO3\CMS\Fluid\ViewHelpers\Security\NonceViewHelper\__construct
‪__construct(private readonly RequestId $requestId)
Definition: NonceViewHelper.php:39
‪TYPO3\CMS\Fluid\ViewHelpers\Security
Definition: IfAuthenticatedViewHelper.php:18