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(); } }
public function actionDelSetting($id) { $RSettings = RSettings::findOne($id); $RSettings->delete(); $this->redirect(['cabinet/default']); }