public function actionCreate()
 {
     $model = new Slider();
     $model->setScenario('create');
     if ($model->load(Yii::$app->request->post(), 'Slider') && $model->validate()) {
         if (SliderService::create($model)) {
             return $this->redirect(['all']);
         }
     }
     return $this->render('create', ['model' => $model, 'scrollTypeMap' => Slider::$scrollTypeMap]);
 }
Beispiel #2
0
 public static function findByName($name)
 {
     return Slider::findByName($name);
 }
Beispiel #3
0
 public function getSlider()
 {
     return $this->hasOne(Slider::className(), ['id' => 'sliderId']);
 }