2016-11-04 87 views
3

有品牌表(它包含brand_id,BRAND_NAME,b_year)和驗證碼我如何獲得所有atrribute標籤在警予1

`Products::model()->getAttributeLabel('brand_id')` 
var_dump(Products::model()->getAttributeLabel('brand_id')); 

它只顯示brand_id標籤。我如何顯示所有標籤而不是一個?

回答

0

試試這個

var_dump(Products::model()->attributeLabels()); 
0

斐伊川attributeLabels()Model一個function。它返回一個arraydatabase領域爲重點。

,讓你不得不只是沒有agruments這樣稱呼它

var_dump(Products::model()->attributeLabels()); // this will return complete array 

凡爲getAttributeLabel是寫在CActiveRecord的所有標籤,並期待和定義的參數也不會給出所有領域lablels

0

請試試這個,

$lables = Products::model()->attributeLabels(); 
print_r($labels); 

$lables回報所有標籤從Products MOD埃爾。