Security.nonce ViewHelper <f:security.nonce>

This ViewHelper resolves the nonce attribute from the global server request object, or from the PolicyProvider service as a fall-back value.

Examples

Basic usage

<script nonce="{f:security.nonce()}">const inline = 'script';</script>
Copied!

Source code

Go to the source code of this ViewHelper: Security\NonceViewHelper.php (GitHub).