Quantcast
Channel: Yii Framework Forum
Viewing all articles
Browse latest Browse all 18717

Add Attribute In Activerecord

$
0
0
I'm trying to add an extra attribute in my model, but without success.

Added to the model attribute:
...
public $extraAttr;
...


and safe in rules
...
array('extraAttr', 'safe'),
...


Even so, this attribute does not appear in:
$model->attributes


I can only access it by:
$model->extraAttr


But I need to access it by aattributes the model. How do?

Thank you!

Viewing all articles
Browse latest Browse all 18717

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>