How do you get the field name, instead of the value, from the model?
Suppose I have a Model Class named Anything, in Yii, and all I want is to
get not the field value, but the field name, how could I do that?
Because using something like:
$anything = new Anything;
$anything->field_name;
Returns the value of that field, which is the purpose for that, still, if
all you want is the string of the name of the field, how could you do
that?
I tried using:
$anything->attributes;
But it just returns an array of field names, I want to try and get a
specific value as a defined constant.
No comments:
Post a Comment