Yii UGridView插件手册详解

手册地址: https://www.yiichina.com/doc/api/2.0/yii-grid-gridview
https://www.cnblogs.com/tystudy/p/6484640.html
1、基本引用:

'dataProvider' => $dataProvider,
    'columns' => [
        'id',
        'name',
        'created_at:datetime',
        // ...
    ],
]) ?>

1、列表输出标签

array(
    'name'  =>  'account_user_name',
//            'value'   =>  '$data->account_user_name',
     'value'=> function($data){
            return "$data->account_user_name";
      },
    'type' => 'raw',       //必须设置为raw
    'htmlOptions'  => array('style' => 'width:150px;')
),

2、表头处理

你可能感兴趣的:(Yii2,Yii1.1)