How Add Thumbnalis


hey i need add thumbnalis for this code this is image upload as URL i try add thumbnail for this but it not work properly[/b]

public function actionCreate()


$model=new Cities;

// Uncomment the following line if AJAX validation is needed

// $this->performAjaxValidation($model);




//image upload


if (is_object($myfile) && get_class($myfile)===‘CUploadedFile’) {

// gimage upload path edite with your path




$myfile->saveAs(Yii::app()->basePath.’/../images/’.$myfile->name);//save image









public function rules()

array(‘image’, ‘file’,‘types’=>‘jpg, gif, png’, ‘allowEmpty’=>true, ‘on’=>‘update’),

array(’ image’, ‘length’, ‘max’=>255, ‘on’=>‘insert,update’),

i newer on YII wall please help thank you

;D :blink: :blink:

refer here

klo dari ane, rekomendasi pake ini gan

Extension Image

untuk buat thumbnailnya,

$image = new Image('images/article/' . [filenamenya]);

$image->resize(350, 350, Image::AUTO)->quality(75);

$image->save('images/350x350-' . [filenamenya]);