在gridview yii2中使用implode

时间:2017-01-03 17:43:31

标签: yii2

我有gridview

[

            'value' => function($data){
            $sum = '';
            foreach ($data->orderInfo as $request){
                $str = ($request->order_items_offer_name);


                $sum .= ($str);
            }

            return implode(',',array($sum)) ;
        }], 

但数据之间没有逗号。

1 个答案:

答案 0 :(得分:1)

试试这个:

<columnConstraints>
    <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints> 
    <RowConstriants />
</rowContraints>