Difference between #18 and #20 of
Common Yii questions

Changes

Title unchanged

Common Yii questions

Category unchanged

FAQs

Yii version unchanged

Tags unchanged

yii, common, questions, beginners

Content changed

[...]
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?
[...]
```

<hr/>
 
 
### what's the difference between exit and Yii::app()->end()
 
 
#### Answer:
 
Both terminates the application. But end method calls onEndRequest event before doing the exit...
 
In this case as in a lot of others the source code explains itself very-well
 
 
 
 
```php 
public function end($status=0, $exit=true)
 
{
 
    if($this->hasEventHandler('onEndRequest'))
 
        $this->onEndRequest(new CEvent($this));
 
    if($exit)
 
        exit($status);
 
}
 
```
 
 
 
14 0
23 followers
Viewed: 59 630 times
Version: 1.1
Category: FAQs
Written by: dckurushin
Last updated by: migajek
Created on: Oct 17, 2011
Last updated: 13 years ago
Update Article

Revisions

View all history