我如何获得所有atrribute标签在警予1

我如何获得所有atrribute标签在警予1

问题描述:

有品牌表(它包含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。它返回一个arraydatabase领域为重点。

,让你不得不只是没有agruments这样称呼它

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

凡为getAttributeLabel是写在CActiveRecord的所有标签,并期待和定义的参数也不会给出所有领域lablels

请试试这个,

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

$lables回报所有标签从Products MOD埃尔。