add attribute on generated <script> tag
shinedira opened this issue · comments
Edwin Diradinata commented
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 <script> tag for initiation of the widget component
What is the expected result?
but what I want is to add an attribute on the generated <script> tag,
for example <script attribute="here-the-new-attribute">
Additional info
Q | A |
---|---|
Yii version | 2.0.37 |
PHP version | 7.3.20 |
Operating system | Windows 11 |
Alexander Makarov commented
What's your use-case?
Edwin Diradinata commented
need an attribute to tag script for content security policy (csp)
<script nonce="key">
What's your use-case?