[ | [ | ||||
'attribute' => 'weight', | 'attribute' => 'weight', | ||||
'value' => function($model) { | 'value' => function($model) { | ||||
if(strlen($model->weight)) { | |||||
if($model->unit == 'piece' && strlen($model->weight)) { | |||||
return $model->weight.' g' ; | return $model->weight.' g' ; | ||||
} | } | ||||
return '' ; | return '' ; |