有品牌表(它包含brand_id,BRAND_NAME,b_year)和驗證碼我如何獲得所有atrribute標籤在警予1
`Products::model()->getAttributeLabel('brand_id')`
var_dump(Products::model()->getAttributeLabel('brand_id'));
它只顯示brand_id標籤。我如何顯示所有標籤而不是一個?
有品牌表(它包含brand_id,BRAND_NAME,b_year)和驗證碼我如何獲得所有atrribute標籤在警予1
`Products::model()->getAttributeLabel('brand_id')`
var_dump(Products::model()->getAttributeLabel('brand_id'));
它只顯示brand_id標籤。我如何顯示所有標籤而不是一個?
試試這個
var_dump(Products::model()->attributeLabels());
斐伊川attributeLabels()
是Model
一個function
。它返回一個array
與database
領域爲重點。
,讓你不得不只是沒有agruments這樣稱呼它
var_dump(Products::model()->attributeLabels()); // this will return complete array
凡爲getAttributeLabel
是寫在CActiveRecord
的所有標籤,並期待和定義的參數也不會給出所有領域lablels
請試試這個,
$lables = Products::model()->attributeLabels();
print_r($labels);
$lables
回報所有標籤從Products
MOD埃爾。