Example #1
0
 public function addImageSlider()
 {
     if ($this->image_slider) {
         $dir = 'files/system/default_page/slider';
         if (!is_dir($dir)) {
             mkdir($dir);
         }
         $dir .= '/' . $this->image_slider->baseName . '.' . $this->image_slider->extension;
         $this->image_slider->saveAs($dir);
         $image = new RImages();
         $image->src = $dir;
         $image->save();
         $RSettings = new RSettings();
         $RSettings->type = 'imageSlider';
         $RSettings->value = $image->id;
         $RSettings->save();
     }
 }
Example #2
0
 public function actionDelSetting($id)
 {
     $RSettings = RSettings::findOne($id);
     $RSettings->delete();
     $this->redirect(['cabinet/default']);
 }