I am developing Yii2 application where I want to list orders data in GridView.
User can click on order id and will be redirected to another GridView with order details listing. I want to display link with order id to redirect to order details page.
But I got the following error:
Class 'CHtml' not found
in GridView. Here is my code:
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
[
'attribute' => 'id',
'value' => CHtml::link("Link", Yii::app()->createUrl("user/view")),
'format' => 'raw',
],
'user_id',
'amount',
'promo_code_used',
['class' => 'yii\grid\ActionColumn'],
],
]) ?>