Fields not listed in rules are not saved
Posted 25 September 2009 - 03:15 PM
why are fields who are not listed in the rules array not saved into my database?
example: Username is listed in the safeAttributes array but not in the rules array, when i fill in the form everthing is stored in my database except the field Username.
Posted 25 September 2009 - 03:38 PM
yes just downloaded a 1.1-dev version this week. so the safeAttributes method is doing nothing...
Only attributes listed in the rules method will be massively assigned? Hoc can i assign fields manualy?
Posted 25 September 2009 - 05:31 PM
This is not exactly manual assigning per se. This very specific use case has been described many times before, please use the search function to find the right answer.
Manual assigning, however, is simple:
$model->attribute = $value;