2016-02-20 37 views
0

如何根據條件突出顯示yii2 detailView中的值? 我試過這種方式(有和沒有'type' => 'raw''html'),但沒有運氣:Yii2 detailView亮點值

[ 
    'attribute' => 'attribute', 
    'type' => 'raw', 
    'value' => $model->attribute > 1 ? '<b>' . $model->attribute . '</b>' : $model->attribute, 
], 

謝謝!

回答

0

您需要使用format屬性,而不是type

'format' => 'html' 
+0

非常感謝!!!! – user2511599