在视图层index.php展示代码中加入[ 'attribute' => 'file', 'format' => 'raw', 'value' => function($model){ return '<img width="70px" src="'.$model->file.'">'; }]attribute为字段名$model->file为你数据库中的路径