Hi,
i remark a yii behave :
for example i have a model that contain
id -->int
name–>string
address–>string
in model’s rules, when i didn’t put a rule for the attribute “name” it will not be saved in DB.
I concluded that I must put inevitably a rule for every attrebute.
Is this a right behave of yii ?
note that i use yii 1.1.4
rudenich
(Rudenich)
2
If you don’t want define rule for some fields, you can mark them as safe.
in rules add
array('name','safe')
zaccaria
(Matteo Falsitta)
3
you can also avoid rules, but this attribute will not be set with $model->attributes.
You can set each value manually, even without rules:
$model->myAttributeWithoutRules= ‘value’;