Set width image in gridview yii2

前端 未结 3 671
情书的邮戳
情书的邮戳 2021-02-15 16:49

how to set width image in gridview widget in yii2?

I\'ve been using this method to display the image. Image in gridview in yii2

3条回答
  •  无人共我
    2021-02-15 17:09

    Use

    'format' => ['image',['width'=>'100','height'=>'100']],
    

    example:

    [           
          'attribute' => 'image',
          'format' => ['image',['width'=>'100','height'=>'100']],
          'value' => function($dataProvider) { return $dataProvide->image; },
    
    
    ],
    

提交回复
热议问题