URL in Yii2 GridView

Solution 1:

Use 'format' => 'raw' instead of 'format' => 'url'.

Solution 2:

I got the solution from Samdark, contributor of yii. need to use format=>'raw':

...    
'format' => 'raw',
     'value'=>function ($data) {
        return Html::a(Html::encode("View"),'site/index');
    },

need to use Html::encode() to ecape XSS