标签:column hid mod 图片 idv open mode status out
1. 去除头顶的 第1条数据 共两条 代码如下
1 <?= GridView::widget([ 2 ‘dataProvider‘ => $dataProvider, 3 ‘filterModel‘ => $searchModel, 4 ‘columns‘ => [ 5 [‘class‘ => ‘yii\grid\SerialColumn‘], 6 7 ‘id‘, 8 ‘name‘, 9 ‘sort_order‘, 10 ‘status‘, 11 12 [‘class‘ => ‘yii\grid\ActionColumn‘], 13 14 ], 15 ‘layout‘=>"{items}\n{pager}", //去除顶部 16 ]); ?>
2.显示图片
1 [ 2 ‘attribute‘ => ‘thumb_path‘, 3 ‘format‘ => ‘raw‘, 4 ‘value‘ => function($model) { 5 return Html::img($model->thumb_path); 6 } 7 ],
后续功能 继续添加
标签:column hid mod 图片 idv open mode status out
原文地址:http://www.cnblogs.com/eddief/p/7076490.html