Answer the question
In order to leave comments, you need to log in
Yii 2 Html::a() options - protection from bad code?
Hello. Please tell me, I'm trying to pass in
Html::a('Delete', ['tasksmanager/task-delete', 'task_id' => $task->id], ['onclick' => 'confirm("Delete?") ;']);
But the onlick attribute just doesn't appear on the link. If you specify 'class' instead of onclick, then the attribute is displayed. Is this protection against bydlokoda?
Answer the question
In order to leave comments, you need to log in
you apparently use a link inside a grid column, and in the default column settings, the type is html, which cleans links from junk using HtmlPurifier. To use the as is reference, you must set the raw type.
I would rather use the data-confirm attribute
Truth is not assured that in .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question