/**
  * Creates a new Pelicula model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new Pelicula();
     $modelActor = [new Actorpelicula()];
     $modelDirector = [new Directorpelicula()];
     $modeltipoPelicula = [new Tipopeliculapelicula()];
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         $modelActor = Model::createMultiple(Actorpelicula::classname());
         Model::loadMultiple($modelActor, Yii::$app->request->post());
         $modelDirector = Model::createMultiple(Directorpelicula::classname());
         Model::loadMultiple($modelDirector, Yii::$app->request->post());
         $modeltipoPelicula = Model::createMultiple(Tipopeliculapelicula::classname());
         Model::loadMultiple($modeltipoPelicula, Yii::$app->request->post());
         $valid = $model->validate();
         $valid = Model::validateMultiple($modelActor) && $valid;
         $valid = Model::validateMultiple($modelDirector) && $valid;
         $valid = Model::validateMultiple($modeltipoPelicula) && $valid;
         return $this->redirect(['view', 'id' => $model->id]);
     } else {
         return $this->render('create', ['model' => $model]);
     }
 }