This seems pretty simple to me, but I can’t see to get it to work. I’ve did some googling and what I found says this should work, but it does not. I am new, so maybe something has changed, but I didn’t find any documentation to prove something changed
I want to add a onClick attribute to a Html::a() helper, but the rendered HTML doesn’t have an onClick attribute
it’s because you format the output as ‘html’.
So the formatter of the GridView (default is the Yii formatter) processes it and uses the HtmlPurifier to strip evil code away.
Change the format type to ‘raw’ and you can use your attribute.