yii2
yii2 copied to clipboard
add attribute on generated <script> tag
What steps will reproduce the problem?
<?php $form = ActiveForm::begin(['id' => 'login-form']); ?>
<?= $form->field($model, 'date_posted')->widget(DatePicker::classname()) ?>
<div class="form-group">
<?= Html::submitButton('Save') ?>
</div>
<?php ActiveForm::end(); ?>
and it generated
What is the expected result?
but what I want is to add an attribute on the generated
Additional info
| Q | A |
|---|---|
| Yii version | 2.0.37 |
| PHP version | 7.3.20 |
| Operating system | Windows 11 |
What's your use-case?
need an attribute to tag script for content security policy (csp)
<script nonce="key">
What's your use-case?
I have the same problem while integrating CSP. I am working on a pull request to address this.