34k+
News
Guide
API
Wiki
Forum
Community
Places
Members
Hall of Fame
Badges
More
Learn
Books
Resources
Develop
Download Yii
Extensions
Report an Issue
Report a Security Issue
Contribute to Yii
Donate
About
Release Cycle
License
Team
Official Logos and Design
Login
Common Yii questions
Comparing
#19
with
#20
Revision #20 was created by
migajek
on Oct 31, 2011, 1:37:08 PM.
one more possible reason for Model::save not working
« Previous (#19)
Content
[...]
return false;
}
```
if you don't want it to validate just do **$method->save(false);**
Other possible reason is that "beforeSave" method (if overridden) doesn't return "true".
<hr/>
### How to connect to database in controller?
#### Answer:
The best approach is to set db connection in your main.php config.
[...]