Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(isset($_POST['Portofolio']))
- {
- $cekfile=$model->picture=CUploadedFile::getInstance($model,'picture');
- if(!empty($cekfile)){
- $model->attributes=$_POST['Portofolio'];
- $model->save();
- }else{
- $model->attributes=$_POST['Portofolio'];
- $model->picture=CUploadedFile::getInstance($model,'picture');
- if($model->save()){
- $model->picture->saveAs(Yii::app()->basePath.self::URLUPLOAD.$model->picture.'');
- $this->redirect(array('view','id'=>$model->portofolio_id));
- }
- }
- }
- $this->render('update',array(
- 'model'=>$model,
- ));
- }
Advertisement
Add Comment
Please, Sign In to add comment