public function run($id) { $model = $this->getModel($id); if (isset($_FILES['Profile'])) { $model->photo = CUploadedFile::getInstance($model, 'photo'); if ($model->save()) { $html = ''; $html = "\n <div class='refresh-content' data-refresh-selector='.avatar-image'>" . Profile::renderFullSizeAvatar($model->id, 60) . "</div>"; echo $html; Yii::app()->end(); } else { throw new CHttpException(500, Yii::t('app', 'Upload failed')); } } return parent::run($id); }