Revision #19 has been created by dckurushin on Oct 26, 2011, 6:31:36 PM with the memo:
what's the difference between exit and Yii::app()->end()
« previous (#18) next (#20) »
Changes
Title
unchanged
Common Yii questions
Category
unchanged
FAQs
Yii version
unchanged
Tags
unchanged
yii, common, questions, beginners
Content
changed
[...]
CHtml::beginForm('', 'post',array('enctype'=>'multipart/form-data'));
//the file field
CHtml::fileField('data', '');
```
<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);
}
```