yiisoft / yii2

Yii 2: The Fast, Secure and Professional PHP Framework

Home Page:http://www.yiiframework.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

add attribute on generated <script> tag

shinedira opened this issue · comments

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

What's your use-case?

need an attribute to tag script for content security policy (csp)
<script nonce="key">

What's your use-case?