获取未知属性:backend \ models \ ProductAttribute :: Size:Yellow,Length:30

时间:2015-11-12 07:44:24

标签: gridview yii2

<?= GridView::widget([
    'dataProvider' => $dataProvider,   
    'columns' => [
        ['class' => 'yii\grid\SerialColumn'],                
         [
            'attribute' =>'id_product_attribute',
            'label' => 'Attribute Value-Pair',
            'value'=>ProductAttributeController::attributepair(),
         ],
        'price',
        'weight',
    ],      
]); ?>

public function attributepair(){     

    $id = $_GET['id'];        
    $attribute_pair = $this->context->actionAttributecombination($id);        
    $attribute_pair = rtrim($attribute_pair, ",");
    return $attribute_pair;
}

$ attribute_pair返回字符串&#34;大小:黄色,长度:30&#34;。如何在gridview中显示此数据?

1 个答案:

答案 0 :(得分:0)

您的功能必须Sub AddRow() Dim LR As Long LR = Range("A" & Rows, Count).End(xlUp).Row Rows(LR).Copy Rows(LR + 1).Insert End Sub ,因为您使用的是static

::