posted by aryo tejo w on September 6, 2016

A sweetener feature in a web is an animated image. Here it can mean moving and changing images. On this web, there is a silder who always change the image, can even added or deleted images if not like. This slider image management module is in the "Upload Image" menu. With the database design to accommodate the uploaded file name, we will direct the slider path to the folder to save it.

With CMultiFileUpload extentiion we can upload multiple image files at once. The Folders path is set inside the params file that resides   /config/params.php

here is the existing slider coding script

$sql="SELECT * FROM file_diupload order by id";
        $dataProvider2=new CSqlDataProvider($sql,array(
            'keyField' => 'id',
            'pagination'=>array(
                'pageSize'=>40,
            ),
        ));
        
            $terserah=array();
            $itu=array();
            $awal=array();
            $iki_fotone=array();
            foreach($dataProvider2->getData() as $i=>$ii)
            {
                $itu[$i]=$ii['nama_file'];
                $awal[$i]=Yii::app()->baseUrl."/uploads/foto/".$itu[$i];
                
                $iki_fotone[$i]=$awal[$i];
                $terserah[$i]=array($iki_fotone[$i],$itu[$i]);
        
            }

Leave a Comment

Fields with * are required.

Please enter the letters as they are shown in the image above.
Letters are not case-sensitive.