Пример #1
0
 /**
  * Creates a new Photos model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate($event = null)
 {
     $model = new Photos();
     if ($model->load(Yii::$app->request->post()) && $model->validate()) {
         $model->event_id = $event;
         $model->save();
         return $this->redirect(['/admin/events/view', 'id' => $event]);
     } else {
         return $this->render('create', ['model' => $model]);
     }
 }